I’m a little stuck on exercise 9. I know the answer but I don’t understand the code.
So it says we need to create a loop with even values up to 20, I know we need to exclude the odd values, but in order to specify what to exclude we say “next if i % 2 == 1”
However odd numbers % 2 does not equal 1, it equals a different number. So how did the reader figure that when we are talking about excluding numbers that essentially we need to add 1 to, in order to divide it by 2 to create a whole number.
i = 20
i -= 1
next if i % 2 == 1
break if i <= 0