Practice Loops In Python (11.8) - 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

Loops in Python

Practice - Loops in Python

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 a for loop to print numbers 0 to 4.

💡 Hint: Use the range function for your loop.

Question 2 Easy

Write a while loop to print 'Hello' three times.

💡 Hint: Initialize a counter and condition before the loop.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What type of loop should be used when the number of iterations is known?

for loop
while loop
both

💡 Hint: Think about how you would iterate over a list or range.

Question 2

True or False: A while loop will run forever if the condition is always true.

True
False

💡 Hint: Remember to consider the condition of the loop.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a program that generates the Fibonacci sequence up to 100 using both for and while loops.

💡 Hint: Remember the Fibonacci sequence starts with 0 and 1.

Challenge 2 Hard

Create a program that accepts user input to keep track of all the numbers entered until a negative number is inputted, then displays the total count and average.

💡 Hint: You'll need both a count and a total to compute the average at the end.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.