Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 1)
1.
What will be the output of the following code?
for i in range(3):
    print(i)
0
1
2
0 1 2
Answer: Option
Explanation:
The range(3) generates values 0, 1, and 2, and the for loop iterates over these values, printing them.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.