Skip to content

Instantly share code, notes, and snippets.

@dhavalsavalia
Created August 5, 2017 23:08
Show Gist options
  • Save dhavalsavalia/d43a23a5421d95d8c806cceaf6c1ecc0 to your computer and use it in GitHub Desktop.
Save dhavalsavalia/d43a23a5421d95d8c806cceaf6c1ecc0 to your computer and use it in GitHub Desktop.
practicepython-exercise-one | Character Input
# defining a function
def ask():
# asking for an input from user
name = input("What is your name? ")
age = int(input("How old are you? "))
# calculating an age left to turn 100
changeInAge = 100 - age
# printing the stuff
print("Nice to meet you, {}! You will turn 100 in {} years.".format(name, changeInAge))
# calling the function
ask()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment