Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python program to print all odd numbers in a range

# Python program to print Even Numbers in given range
 
start = int(input("Enter the start of range: "))
end = int(input("Enter the end of range: "))
 
#create a list that contains only Even numbers in given range
even_list = range(start, end + 1)[start%2::2]
 
for num in even_list:
    print(num, end = " ")
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #program #print #odd #numbers #range
ADD COMMENT
Topic
Name
2+4 =