Created
August 5, 2017 23:08
-
-
Save dhavalsavalia/d43a23a5421d95d8c806cceaf6c1ecc0 to your computer and use it in GitHub Desktop.
practicepython-exercise-one | Character Input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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