Practice What is the FOR Loop? - 21.2.1 | 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

Write a FOR loop to print numbers from 1 to 3.

💡 Hint: Use range to set starting and stopping values.

Question 2

Easy

Create a FOR loop to print each letter in the word 'cat'.

💡 Hint: Loop through the characters of a string.

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 a FOR loop?

  • To make a decision
  • To repeat code
  • To stop execution

💡 Hint: Think about the use of loops in programming.

Question 2

True or False: The range function is used to define the number of iterations in a FOR loop.

  • True
  • False

💡 Hint: Recall how iterations work in loops.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Create a FOR loop that returns the squares of numbers from 1 to 10.

💡 Hint: Remember to use the power operator to calculate squares.

Question 2

Develop a FOR loop that counts how many vowels are in a given string.

💡 Hint: Initialize a count variable and check each letter against the vowels.

Challenge and get performance evaluation