print("Enter 'e' for exit."); num = input("Enter any number: "); if num == 'e': exit(); try: number = float(num); except ValueError: print("Please, enter a number..."); else: check = number%2; if check == 0: print(int(number), "is an even number."); elif check == 1: print(int(number), "is an odd number."); else: print(number, "Float number");
Python program to check number is odd or even.
Reviewed by
on
December 26, 2019
Rating:
No comments: