8. Write a python program to print all the numbers from 1 to 20 except even number. Note that continue is an important statement to be used in this case.
The output is:
Expected Answer:
1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Sample Answer:
for i in range(1, 20): if (i == 2): continue print(i, end=' ') print("\n")
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)