Lesson 11 of 34
if inside if: Nested Conditions
8 min 30 XP
Sometimes you can only ask the second question after the first one is answered. Then you write an if inside another if, indented 4 more spaces.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.Indentation decides which else belongs to which if. Each if and its else must line up.