Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. """
  2. Create a program that asks the user to enter their name and their age.
  3. Print out a message addressed to them that tells them the year that they
  4. will turn 100 years old.
  5. Extras:
  6. Add on to the previous program by asking the user for another number and
  7. printing out that many copies of the previous message. (Hint: order of
  8. operations exists in Python).
  9. Print out that many copies of the previous message on separate lines.
  10. """
  11.  
  12.  
  13. name = input("Enter your Name: ")
  14. age = int(input("Enter your age: "))
  15. copy = int(input("How many copies: "))
  16.  
  17. for x in range(copy):
  18. print("Your name is %s, your age is %d, you will be 100 years old in %d years"
  19. % (name, age, 100-age))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement