Practice Using FOR with Lists - 21.2.4 | 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

Using FOR with Lists

21.2.4 - Using FOR with Lists

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 that prints numbers from 1 to 5.

💡 Hint: Use the range function.

Question 2 Easy

Create a list of three fruits and iterate through it to print each fruit.

💡 Hint: Think about how to access list elements in a loop.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is the correct syntax for a FOR loop in Python?

for variable in list:
loop variable = list
while variable in list

💡 Hint: Look for the keyword 'for' in the syntax.

Question 2

True or False: The FOR loop can only iterate over numbers.

True
False

💡 Hint: Recall that lists can contain various data types.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a program that accepts a user input list of names and prints them in alphabetical order using a FOR loop.

💡 Hint: You need to sort the list before printing.

Challenge 2 Hard

Write a FOR loop that generates the Fibonacci sequence up to a specified count and prints it.

💡 Hint: Remember the classic Fibonacci definition where the next number is the sum of the two preceding ones.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.