Skip to content

Instantly share code, notes, and snippets.

@ehedaoo
Created April 30, 2017 17:51
Show Gist options
  • Save ehedaoo/269e4a71667354636da63a85f9eff6d4 to your computer and use it in GitHub Desktop.
Save ehedaoo/269e4a71667354636da63a85f9eff6d4 to your computer and use it in GitHub Desktop.
Ask the user for a number. Depending on whether the number is even or odd. print out an appropriate message to the user. If the number is a multiple of 4, print out a different message.
# Ask the user for a number. Depending on whether the number is even or odd.
# print out an appropriate message to the user.
# If the number is a multiple of 4, print out a different message.
num = int(input("Enter a number: "))
if num % 2 == 0:
if num % 4 == 0:
print("Your number is a multiple of 4")
else:
print("Your number is even")
else:
print("Your number is odd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment