Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Created August 11, 2013 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6202858 to your computer and use it in GitHub Desktop.
Save stevencombs/6202858 to your computer and use it in GitHub Desktop.
# Function to determine if number is odd or even
# A Codecademy Python (Function and Control) assignment
# Dr. Steven B. Combs, coding novice
def is_even(x):
if x % 2 == 0: # If varialble is divisible by 2 without remainder
return "yep" # The variable is even
else:
return "nope"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment