Answers for "python get odd numbers"

8

program to find even numbers in python

m = int(input("Enter number"))
if m % 2 == 0:
    print(m,"is an even number")
else:
    print(m,"is an odd number")
Posted by: Guest on July-24-2020
10

how to check if a number is odd python

num = int(input("Enter a number: "))  
if (num % 2) == 0:  
   print("{0} is Even number".format(num))  
else:  
   print("{0} is Odd number".format(num))  
Posted by: Guest on May-21-2020
0

how to sum only the odd values in python

>>> lst = [0, 1, 2, 3, 4, 5]>>> sum(n for n in lst if n % 2 != 0)9
Posted by: Guest on March-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language