Practice If Statement (11.7.1) - Python Programming - CBSE 11 AI (Artificial Intelligence)
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

if Statement

Practice - 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.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Write an if statement to check if a person is eligible to drive at the age of 16.

💡 Hint: Think about the age limit for driving.

Question 2 Easy

Using an if statement, print 'Hello' if the user name is 'Alice'.

💡 Hint: You will need an equality check with '=='

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the if statement do?

Executes code if the condition is false
Executes code if the condition is true
Does nothing

💡 Hint: Remember the basic syntax of the if statement.

Question 2

True or False: The else statement is executed when its corresponding if condition is true.

True
False

💡 Hint: Think about when the else block activates.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a Python program that asks the user for a temperature in degrees Celsius. If the temperature is below 0, print 'Freezing'. If it's between 0 and 30, print 'Normal'. If it's above 30, print 'Hot'.

💡 Hint: Think about the ranges and structure your if-elif-else based on those.

Challenge 2 Hard

Design a program that asks a user to input their age and suggests whether they can enter a club (18+). Additionally, if the user is under 12, suggest other activities.

💡 Hint: Use multiple pathways to guide the user appropriately.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.