Log in
Sign up for FREE
arrow_back
Library
loops - day1 -22/05/25
By Sini Thomas
star
star
star
star
star
Share
share
Last updated 9 months ago
4 questions
Add this activity
1
1
1
1
Question 1
1.
What will the following code output? for i in range(3): print(i)
0 1 2
0 1 2 3 4
1 2 3
0 1 2 3
Question 2
2.
How many times will 'Python' print? for i in range(5): print('Python')
0
6
5
4
Question 3
3.
What output results from this loop? for i in range(2,5): print(i)
2 3 4 5 6
2 3 4 5
1 2 3
2 3 4
Question 4
4.
What does this code print? for i in range(1,4): print(i*2)
1 3 5
2 3 4
2 4 6
0 2 4