0
Help me why for i in range(0,4): for j in range(0,i): print(i, j) Have output 10,20,21,30,31,30 ?
4 Antworten
+ 2
i = 0, for j in range(0,0): Nothing
i = 1, for j in range(0,1): print i and j once (1,0)
i = 2, ... range(0,2): print i and j twice (2,0) (2,1)
i = 3, ... range(0,3): print i and j three times (3,0) (3,1) (3,2)
+ 1
Thats mean when i=3 or whatever it is, when print j is following i, right?
+ 1
Amanbek Orynbay Correct! It prints the integer j where 0 ≤ j < i
+ 1
Okay, thank you so much