Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial →
← CoursesPython FoundationsModule 3 · Functions and stringsPredict: in for stringspredict38 / 174
+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"?
Predict the output

Read the code carefully

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

What will the program print? Write here:

💬 Discussion

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