0
Why this pyrhon code stops counting at 2009 and not at 2010?
ans = list(range(1980, 2010)) max_ans = len(ans) print(max_ans) counter = 0 while counter <= max_ans - 1: an = ans[counter] print (an) counter = counter + 1
2 odpowiedzi
+ 6
That's how range() works. range(a, b) goes from a to b-1.
+ 2
Thanks for your quick answer 😊