Skip to content

Instantly share code, notes, and snippets.

@harfordt
Last active August 29, 2015 14:27
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 harfordt/b5343eb047dfefb0697a to your computer and use it in GitHub Desktop.
Save harfordt/b5343eb047dfefb0697a to your computer and use it in GitHub Desktop.
# inline int casting
user_age = int(input("Your age: "))
# separating the input from the cast
age_as_string = input("Your age: ")
user_age = int(age_as_string)
# this is more confusing, using the same variable name
user_age = input("Your age: ")
user_age = int(user_age)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment