1.3 - 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
Write an if statement that prints 'Hello' if a variable x is greater than 10.
💡 Hint: Think about the condition you're checking.
Create an if-else statement that checks if a number is even or odd.
💡 Hint: Use the modulus operator %.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does an if statement do?
💡 Hint: Remember the conditional nature of if statements.
True or False: An if-else statement is used when you want to handle one condition only.
💡 Hint: Consider what happens when the condition is false.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Write a program that takes an input of grades and provides feedback such as 'Excellent', 'Good', or 'Needs Improvement' based on the grade ranges.
💡 Hint: Use elif to handle multiple outcomes based on the input grade.
Create a program that checks the weather condition from user input and responds differently based on conditions like 'rain', 'sunny', or 'cloudy'.
💡 Hint: Use if-elif to give multiple responses based on specific inputs.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.