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
Write a simple if statement to check if a number is positive.
💡 Hint: Use 'if number > 0:' in your statement.
Create an else statement that prints 'Not positive' if the number is not greater than zero.
💡 Hint: Remember how the else statement works.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What keyword is used to conditionally execute a block of code?
💡 Hint: Think about the statement that starts with 'if'.
True or False: The else statement is executed if the if condition is true.
💡 Hint: Remember what happens when the if condition is true.
1 more question available
Challenge Problems
Push your limits with advanced challenges
Write a program that categorizes animals based on the number of legs (e.g., 2 for birds, 4 for dogs, etc.). Provide a message for any other case.
💡 Hint: Think about what animals you can categorize and their typical leg counts.
Create a program that assigns grades based on numerical scores using conditionals (A, B, C, D, F). Define the ranges for each grade.
💡 Hint: Remember to define clear ranges for each grade before writing the code.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.