Q:

write python function to check if a number is even or odd

0

write python function to check if a number is even or odd

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def is_even(number):
  if (number % 2) == 0:
      status = True
  else:
      status = False
  return status
  
number = int(input('Enter a number:'))
if is_even(number):
 print ('The number is even.')
else:
 print ('The number is odd.')

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now