Q. Write a program chkOdd() that takes one argument and report if the argument is odd or not .
Answer =
def chkOdd(x): if x%2==0: return "even" else : return "Odd" a = int (input ("Enter the positive number :- ")) print(chkOdd(a))
Output:-
Enter the positive number :- 25
Odd
>>>
Enter the positive number :- 16
even
>>>
Enter the positive number :- 00
even
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )