21.1.1 - What is the IF Statement?
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 to check if a number is positive.
💡 Hint: Think about how to compare the number with zero.
Provide the ELSE part to notify if the number is not positive.
💡 Hint: Consider what needs to happen when the condition is false.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is the main purpose of the IF statement in programming?
💡 Hint: Think about the condition it checks.
True or False: The ELSE statement is optional in an IF structure.
💡 Hint: Consider whether it's possible to have only an IF statement.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Create a program that accepts user input and checks if the input number is both even and greater than 10. Provide appropriate messages for each scenario.
💡 Hint: Think about using nested IF statements for the conditions.
Develop an IF-ELIF-ELSE application where the program can grade students based on their activity participation during a course. Assume participation scores are out of 100.
💡 Hint: Remember to define the function first, and then use conditions to categorize the score.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.