Practice Try It Yourself - 4.7 | Control Flow – if, elif, else | Python Programming Language
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.

4.7 - Try It Yourself

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 related to the topic.

Question 1

Easy

Write a simple Python program to check if a number is positive or negative.

💡 Hint: Think about what conditions need to be checked.

Question 2

Easy

Create a program that prints whether a user input is even or odd.

💡 Hint: Use if to check if the number % 2 equals 0.

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 statement is used to check conditions in Python?

  • if
  • loop
  • function

💡 Hint: Think about what structures control program flow.

Question 2

True or False: The else statement executes when the if condition is True.

  • True
  • False

💡 Hint: Recall what happens when conditions aren't met.

Solve 3 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Design a program that outputs whether a number is a prime number or not, including error handling for invalid inputs.

💡 Hint: Remember to validate the number before checking if it's prime.

Question 2

Create a voting eligibility program that includes state-specific rules, checking not just age and ID but residency.

💡 Hint: Nested conditions will help refine eligibility based on multiple factors.

Challenge and get performance evaluation