In this python if else program, we will program to print all numbers from 10-15 except 13
Steps to solve the program
- Use for loop with the range function to iterate over all the numbers from 10-15.
- During iteration check whether the number is not equal to 13 using an if-else statement.
- Print only those numbers.
for i in range(10,16):
if i!=13:
print(i)
Output :
10
11
12
14
15
Related Articles
Python program to find the electricity bill. According to the following conditions:
Python program to check whether a given year is a leap or not.
Python program to check whether an alphabet is a vowel.
Python program to check whether an alphabet is a consonant.
Python program to convert the month name to the number of days.