0

I cant understand this code

i = 0 for a in range(0,2): for b in range(0,2): for c in range(0,2): for d in range(0,2): for g in range(0,2): for f in range(0,2): i += 1 print(f'e: {i}')

13th Mar 2021, 11:38 AM
MoX
2 Réponses
+ 2
Outer loop one iteration == inner loop whole iteration . So your code add 1 to variable i 2**6 times . so final value of i is 64.
13th Mar 2021, 11:42 AM
TOLUENE
TOLUENE - avatar
0
Thanks
13th Mar 2021, 11:42 AM
MoX