Practice What is the FOR Loop? - 21.2.1 | 21. IF, FOR, WHILE | CBSE 9 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

What is the FOR Loop?

21.2.1 - What is the FOR Loop?

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 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.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

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.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

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

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

Challenge 2 Hard

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.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.