+ 1
What is the output of this code?
for i in range (5): i=i+i print(i) Answer is 8.how??
2 Answers
+ 1
Range would generate a list from 0 to 4 with which the for loop would go through. Last iteration would mean that i = 4 and that i = 4 + 4, which would output 8
+ 1
thank you so much