The program loops 1-10 but the user can choose whether they want to print only the even numbers, only the odd numbers, or all the numbers.
So, if the user choose to print only evens then the output should be: 2 4 6 8 10
If only odd: 1 3 5 7 9
All: 1 2 3 4 5 6 7 8 9 10
But when I run my code below, it works normally for print all but for print only even or print only odd then it won't run the program at all. So I was wondering what may be the mistakes here.
MODE = ["Only Even", "Only Odds", "All Numbers"]
for i,v in enumerate(MODE):
print i+1, v
count = 0
s = int(input("Enter Mode Wanted: "))
if s == 3:
while count < 10:
print count+1
count += 1
elif s == 2:
while count <=10:
if count%2 != 0:
print count
count += 1
elif s == 1:
while count <= 10:
if count%2 == 0:
print count
count += 1