Last active
November 1, 2017 05:14
-
-
Save sunnyeyez123/55b6634371b07beb371a9e26d2186fa1 to your computer and use it in GitHub Desktop.
Create a program that asks the user to enter their name and their age. Print out a message addressed to them that tells them the year that they will turn 100 years old. Extras: Add on to the previous program by asking the user for another number and printing out that many copies of the previous message.
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
'''Character Input Create a program that asks the user to enter their name and | |
their age. Print out a message addressed to them that tells them the year that | |
they will turn 100 years old. | |
Extras: | |
Add on to the previous program by asking the user for another number and printing | |
out that many copies of the previous message. | |
Source:http://www.practicepython.org/ | |
''' | |
name, age, count = raw_input("Please enter your 'name, age, number'. ex: Jaz, 26, 2: ").split(',') | |
one_hundred = 100 -int(age) | |
for n in range(int(count)): | |
print "Hello %s! You will be 100 years old in %d years" % (name, one_hundred) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment