I'd like to print all the even numbers from 2 to 10, including 10 itself.
Here's my code:
for i in range(2,10): print(i)
It's not working because it prints odd numbers too, and doesn't print 10 -- can you help me out?
I got you fam :)
for i in range(2,11,2): print(i)
range doesn't include the last number and the extra number at the end is the set value for what it should be counted up by - according to Dr. Stonedahl from class.