+ 1
I think this has wrong answer?
for i in range(10): if not i%2 == 0: print(i) The answer here is that it will print all even numbers between 2 and 10 but actually it prints odd numbers between 1 to 9.
2 Antworten
+ 2
basically,
i%2 == 0 - all even numbers
not i%2 == 0 - tries to find numbers that are NOT even.