Reputation: 39
Suppose that 'i' is 90 and 90%10 = 0, it does not print 90.
numbers = [1,100]
for i in numbers:
if i%10 == 0:
print(i)
Output:
100
Should be: 10, 20 ... 100?
Upvotes: 0
Views: 154
Reputation: 68
Your list only contains the values 1 and 100, not the range of numbers between 1 and 100. Use range instead.
numbers = range(1, 100)
Upvotes: 3