Practice Explanation - 21.2.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 will be printed if age = 20 and using: if age >= 18: print('Adult')?

💡 Hint: Think of how the condition evaluates.

Question 2

Easy

Which keyword is used to create a fallback option in a condition?

💡 Hint: Consider the opposite scenario from the initial IF.

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 does an IF statement do?

  • Executes code unconditionally
  • Executes code based on a condition
  • Executes code with errors

💡 Hint: Recall how it checks a condition before executing.

Question 2

If you use an ELSE statement, what does it represent?

  • True
  • False

💡 Hint: Think about its role in providing an alternative path.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Create a simple text-based game where a player can enter different commands based on user input. Use IF-ELIF-ELSE to handle at least three different types of input.

💡 Hint: Think about how you structure based on commands given by players.

Question 2

Design a voting eligibility checker that returns personalized messages depending on the user's age and residence. Use multiple conditions.

💡 Hint: Consider how different attributes affect eligibility.

Challenge and get performance evaluation