You've learned how if-else
statements create exactly two possible paths for your code. One path runs when the condition is True
, and the other runs when it's False
.
Engagement Message
Ready to practice this powerful decision-making tool?
Type
Multiple Choice
Practice Question
What will this code output?
A. Excellent! B. Good job! C. Both messages will print D. Nothing will print
Suggested Answers
- A
- B - Correct
- C
- D
Type
Fill In The Blanks
Markdown With Blanks
Fill in the blanks to check if a password is correct:
Suggested Answers
- if
- else
- elif
- while
Type
Sort Into Boxes
Practice Question
Sort these scenarios into the correct boxes based on whether they need an if-else
structure:
