Skip to content

Instantly share code, notes, and snippets.

@totallymike
Created June 6, 2012 18:01
Show Gist options
  • Save totallymike/2883630 to your computer and use it in GitHub Desktop.
Save totallymike/2883630 to your computer and use it in GitHub Desktop.
input
# input(a string) prints the string as the prompt, then listens to stdin
# int() converts strings (what you get from stdin) to integers
age = int( input("Enter your age: ") )
if age > 64:
print("You're old")
elif age > 17:
print("You can vote!")
else:
print("Nope!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment