Skip to main content
← CoursesPython FoundationsModule 3 · Functions and stringsPredict: in for stringspredict36 / 170
💬 Discuss🧪 Playground+75 XP
Task
📝 **Task:** Predict what the program will output. ```python print("cat" in "category") print("dog" in "category") ``` 📋 **What needs to be done:** 1. Write in the field what you think will be displayed 2. Click "Check" 💡 **Hint:** The `in` operator for strings looks for a substring. If there is a substring - `True`, otherwise - `False`. 🎯 Think: is there "cat" inside "category"? What about "dog"?

Keep going

🔮 Predict the output

Read the code carefully

print("cat" in "category")
print("dog" in "category")

What will the program print? Write here:

📣 Help someone learn PythonShare this lesson with a friend — the first 15 are free, no signup.Tweet

💬 Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…