Practice - Conditional Statements
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What will be printed if age is 20 and we have: 'if age > 18: print("Eligible to vote")'?
💡 Hint: Think about what the condition is checking.
In the statement: 'if x < 5: print("Less than 5"); else: print("5 or more")', what will be printed when x is 3?
💡 Hint: Consider whether 3 is less than 5.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What keyword is used to create a conditional statement that checks a condition?
💡 Hint: Think of which keyword is related to conditions.
True or False: An if statement can exist without an else block.
💡 Hint: Remember that optionally you can just check a single condition.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Write a Python program using conditional statements to categorize a number as positive, negative, or zero.
💡 Hint: Consider how to assess each category accurately.
Create a program that checks the type of triangle based on the lengths of its three sides.
💡 Hint: Think about how to compare the values of the sides.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.