Advertisement
Luninariel

Hello.py

Jun 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. '''
  2. This program will perform the following.
  3. * Greet a User
  4. * Collect the Users name
  5. * Greets the User by name
  6. * Collects the users age
  7. * Adds one year to it to find how old they'll be next year
  8. '''
  9.  
  10.  
  11. #print a greeting
  12. print ('Hello User')
  13.  
  14. #ask user for their name and collect it
  15. print('What is your name?') #ask for name
  16. myname = input() #collects name
  17.  
  18. #Greets the user and returns name
  19. print('It is good to meet you '+myname)
  20.  
  21. #calculate length of name
  22. print('The length of your name is: ')
  23. print(len(myname))
  24.  
  25. #collect the users age
  26. print('What is your age') #ask for their age
  27. myage = input()
  28.  
  29. #Print the users age and add 1 to it to collect how old they'll be in a year.
  30. print('You will be ' + str(int(myage) + 1) + ' in a year.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement