← All topics
Quiz: Python Conditions: questions with answers
13 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. What does this print? (code)
- Q3. Which condition checks that age is between 18 and 30, inclusive?
- Q4. What is wrong with this code? (code)
- Q5. Is 1900 a leap year according to the rule (year % 4 == 0 and year % 100 != 0) or year % 400 == 0?
- Q6. What does this print? (code)
- Q7. How many branches of an if / elif / elif / else chain can run at most?
- Q8. What does this print? (code)
- Q9. What does this print? (code)
- Q10. What does this print? (code)
- Q11. What does this print? (code)
- Q12. Which line correctly checks that a string name is empty?
- Q13. What does this print? (code)