Practice The FOR Loop - 21.2 | 21. IF, FOR, WHILE | CBSE Class 9 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

What will the following code output? for i in range(0, 3): print(i)

💡 Hint: Count from the start value up to but not including the stop value.

Question 2

Easy

Write a FOR loop to print 'Hello' 5 times.

💡 Hint: How many times do you want to print the message?

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 does the range function in a FOR loop do?

  • It determines how many times to loop.
  • It creates a list of strings.
  • It only allows for even numbers.

💡 Hint: Think about what aspect of iteration the range function influences.

Question 2

True or False: A FOR loop can be used to iterate through a list.

  • True
  • False

💡 Hint: Consider the flexibility of FOR loops.

Solve 2 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a FOR loop that prints numbers from 20 to 0, decrementing by 2 each time.

💡 Hint: Remember how the step value adjusts the direction and increment.

Question 2

Consider a scenario where you have a list of student scores. Write a FOR loop to print a message for each score, indicating if it is a pass (>= 50) or a fail (< 50).

💡 Hint: You're checking a condition for each score; think about how if-else statements work.

Challenge and get performance evaluation