Skip to content

Instantly share code, notes, and snippets.

@srahuliitb
Created August 29, 2017 03:56
Show Gist options
  • Select an option

  • Save srahuliitb/70ad007608d4af15a18bb9f129757b13 to your computer and use it in GitHub Desktop.

Select an option

Save srahuliitb/70ad007608d4af15a18bb9f129757b13 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.
number = int(raw_input("Enter a number: "))
if number % 2 == 0:
print (str(number) + " is an even number.")
else:
print (str(number) + " is an odd number.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment