Skip to content

Instantly share code, notes, and snippets.

@lbattaglioli2000
Created June 21, 2016 23:39
Show Gist options
  • Save lbattaglioli2000/ebc26e369b170b41d1ea0f20b0ff5087 to your computer and use it in GitHub Desktop.
Save lbattaglioli2000/ebc26e369b170b41d1ea0f20b0ff5087 to your computer and use it in GitHub Desktop.
# Convert the string they entered to an integer
age = int(input("How old are you: "))
# Determine how old the user will be after three years.
# You need to convert it to an integer because you cannot do math on a string. You'll get an error. Try it!
threeYears = age + 3
# Tell the user how old they'll be in three years.
# The integer threeYears must be converted to a string in order to be printed.
print("In three years you'll be " + str(threeYears)) # This is concatenation, we'll learn this in the next lesson.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment