🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. What does this print? (code)
  2. Q2. What does this print? (code)
  3. Q3. Which condition checks that age is between 18 and 30, inclusive?
  4. Q4. What is wrong with this code? (code)
  5. Q5. Is 1900 a leap year according to the rule (year % 4 == 0 and year % 100 != 0) or year % 400 == 0?
  6. Q6. What does this print? (code)
  7. Q7. How many branches of an if / elif / elif / else chain can run at most?
  8. Q8. What does this print? (code)
  9. Q9. What does this print? (code)
  10. Q10. What does this print? (code)
  11. Q11. What does this print? (code)
  12. Q12. Which line correctly checks that a string name is empty?
  13. Q13. What does this print? (code)