Practice while Loop - 11.8.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

Create a while loop that prints numbers from 1 to 3.

💡 Hint: Ensure you start counting at 1 and know when to stop.

Question 2

Easy

Write a while loop that prints 'Hello!' three times.

💡 Hint: Track how many times you've printed 'Hello!'.

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 keyword is used to create a while loop in Python?

  • for
  • while
  • loop

💡 Hint: Think about which keyword indicates a repeating condition.

Question 2

True or False: A while loop can lead to an infinite loop if the condition is never updated.

  • True
  • False

💡 Hint: Consider what happens if we forget to adjust the condition.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a program that simulates a simple ATM that allows the user to withdraw money until they choose to exit by entering 'exit'.

💡 Hint: Track the user's actions properly, and remember to check their balance after each transaction.

Question 2

Create a program that continually asks for a password until the user enters 'Python123'. Provide feedback for wrong entries.

💡 Hint: Ensure to give feedback on what the user input was if incorrect.

Challenge and get performance evaluation