Skip to content

Instantly share code, notes, and snippets.

Created Sep 4, 2017
What would you like to do?
A program to check if a number is odd or even
0: "zero",
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
8: "eight",
9: "nine"
number = input("Enter a number: ")
word = NUMBERS[int(number[-1])]
if "e" in word[-2:]:
print(f"{number} is odd")
print(f"{number} is even")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment