Practice IF-ELSE Statement - 21.1.3 | 21. IF, FOR, WHILE | CBSE Class 9 AI (Artificial Intelligence)
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

What is the purpose of an IF statement?

💡 Hint: Think about how we decide what to do based on questions.

Question 2

Easy

Write a simple IF statement to check if a number is positive.

💡 Hint: Make sure you are checking the number correctly!

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What will be printed if age = 15 in the following code?
if age >= 18:
print('Eligible to vote')
else:
print('Not eligible to vote')

  • Eligible to vote
  • Not eligible to vote

💡 Hint: Remember what the if condition checks for.

Question 2

In Python, can you have multiple IF statements without chaining them with ELIF?

  • True
  • False

💡 Hint: Think about how we can check things independently.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a program that uses nested IF-ELIF-ELSE statements to evaluate a player's score in a game and categorize them as Beginner, Intermediate, Expert, or Pro based on different ranges.

💡 Hint: Think about the ranges you want to define for each category.

Question 2

A theatre group uses conditional statements to decide ticket prices. Write an IF-ELIF-ELSE statement that handles discounts for children, adults, and seniors.

💡 Hint: Consider how age impacts ticket pricing and what categories you will use.

Challenge and get performance evaluation