sarahalbaloushi sarahalbaloushi
  • 16-08-2021
  • Computers and Technology
contestada

write a program to check whether the number is odd or even using 'if' statement in python

Respuesta :

belongtoinsarifamily
belongtoinsarifamily belongtoinsarifamily
  • 16-08-2021

Answer:

Python Program to Check if a Number is Odd or Even :

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))

Answer Link

Otras preguntas

How did economic imperialism lead to India’s becoming a British colony?
What is the difference between de facto and de jure segregation? Which does the policy of bussing attempt to solve?
Solve each problem by using the quadratic formula. Write solutions in simplest radical form. 2x2 + 2x – 2 = 0
What was the connection between anti-Semitism and Zionism?
How did economic imperialism lead to India’s becoming a British colony?
How does a constitutional monarchy differ from an absolute monarchy?
What three actions demonstrated that Philip II of Spain saw himself as a defender of Catholicism?
In what ways was Santa Anna a typical caudillo?
Solve each problem by using the quadratic formula. Write solutions in simplest radical form. 2x2 + 2x – 2 = 0
A) three numbers sum to 15. The mode of the three numbers is 1. What must the three number be? ______, ______ and _____ B) three numbers have a mode of 5 and