Answers for "python print odd numberrs"

0

python print odd numberrs

# Python program to print all ODD numbers in the range[a, b]
a, b = (7, 19)

for num in range(a, b+1): # b+1 is to include b itself
  if num & 1:
    print(num, end = ' ')
# output:
# 7 9 11 13 15 17 19
Posted by: Guest on April-30-2022
-1

how to print even numbers in python

# Python program to print Even Numbers in given range
  
start, end = 0, 50
  
# iterating each number in list
for num in range(start, end + 1):
      
    # checking condition
    if num % 2 == 0:
        print(num, end = " ")
Posted by: Guest on March-06-2022

Python Answers by Framework

Browse Popular Code Answers by Language