3.4.1 - A. 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.
Practice Questions
Test your understanding with targeted questions
Write a for loop to print numbers from 1 to 10.
💡 Hint: Remember to start from 1 and go up to 10.
Modify the loop to print even numbers from 2 to 20.
💡 Hint: Think about how you can skip odd numbers.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does a for loop do in programming?
💡 Hint: Think about the purpose of loops.
True or False: A for loop can iterate through an array.
💡 Hint: Recall how we've used for loops with arrays in class.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Using a for loop, write a program to print a triangle of asterisks where the number of rows is provided by the user.
💡 Hint: You will need a nested loop to manage the number of asterisks in each row.
Create a for loop that reverses a string provided by the user and prints it.
💡 Hint: You will iterate from the end of the string to the beginning.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.