Log in
Sign up for FREE
arrow_back
Library

Exit Ticket For loop

star
star
star
star
star
Last updated about 2 years ago
8 questions
1
1
1
1
1
1
1
1
Question 1
1.

What does a for loop do in Python?

Question 2
2.

What is the output when you execute: `for i in range(5): print(i)` in Python?

Question 3
3.

Given the for loop `for i in range(2,10,2): print(i)`, what is the output?

Question 4
4.

How would you initialize a for loop to iterate over a list ['apple', 'banana', 'cherry'] in Python?

Question 5
5.

What does the 'range' function do in a Python 'for' loop?

Question 6
6.

What is the starting index when using a 'for' loop with the 'range' function in Python?

Question 7
7.

How would you write a for loop in Python to iterate from 1 to 5?

Question 8
8.

What is the Python for loop structure to print the numbers 3, 4 and 5?