for i in range(5): print("hello!") - shouldn't this list out 6 lines (0-5?) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

for i in range(5): print("hello!") - shouldn't this list out 6 lines (0-5?)

25th Mar 2020, 6:58 PM
kevin
1 Answer
+ 5
kevin 5 is excluded. for i in range(5) means 0 up to 4.
25th Mar 2020, 7:00 PM
Avinesh
Avinesh - avatar