Practice Control Structures - 8.1.2 | 8. Advanced Python – Revision and Functions | CBSE Class 12th 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

Create an if-else statement that checks if a number is positive or negative.

💡 Hint: Think about how you can determine if a number is greater or less than zero.

Question 2

Easy

Write a for loop that prints the first 5 positive integers.

💡 Hint: You want to iterate from 1 to 5.

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 is the purpose of an if-else statement?

  • To create loops
  • To make decisions in code
  • To define functions

💡 Hint: Think about what an if statement does.

Question 2

True or False: For loops require a condition to stop iterating.

  • True
  • False

💡 Hint: Consider how a for loop functions compared to a while loop.

Solve 2 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a program that uses if-else statements to categorize animals based on their type: Mammals, Birds, etc. Use user input for animal type.

💡 Hint: Use lists to define the categories of animals.

Question 2

Write a program that prompts the user to enter a number and prints whether it's odd or even using a while loop.

💡 Hint: Think about using the modulus operator to determine if a number is even or odd.

Challenge and get performance evaluation