Practice if-else Statement - 11.7.2 | 11. Python Programming | CBSE Class 11th 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

Write an if-else statement to check if a variable x is greater than 5.

💡 Hint: Remember to correctly format your conditions.

Question 2

Easy

Create an if statement to print 'Good morning' if the hour is less than 12.

💡 Hint: Only check the hour condition.

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 the following code print if age is 16?

Code Editor - python
  • Adult
  • Minor

💡 Hint: Think about what the comparison operator does!

Question 2

True or False: The elif statement can be used to chain multiple conditions.

  • True
  • False

💡 Hint: Recall how we can check multiple scenarios sequentially.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a program that checks a user's username. If it is 'admin', print 'Access granted'; if it is 'guest', print 'Access limited'; otherwise, print 'Access denied'.

💡 Hint: Remember to check the username step-by-step.

Question 2

Create a grading system based on scores. If the score is 90 or above, print 'Grade: A'; if between 80 and 89, print 'Grade: B'; if between 70 and 79, print 'Grade: C'; otherwise, print 'Grade: F'.

💡 Hint: Use sequential checking for grading conditions.

Challenge and get performance evaluation