Guest User

Untitled

a guest
Dec 8th, 2019
104
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Create a function with one parameter, name, which will be the name of a person.
  2. #The function should then “sing” Happy Birthday to that person, inserting their name at the correct point.
  3. #Give your function a sensible name.
  4.  
  5. import time
  6.  
  7.  
  8. def person():
  9. yourname=input("What is your name? ")
  10. return yourname
  11.  
  12. def happy_bday(name):
  13. for i in range(2):
  14. print("Happy birthday to you")
  15. time.sleep(1)
  16. print("Happy birthday dear", name)
  17. time.sleep(1)
  18. print("Happy birthday to you")
  19.  
  20. name=person()
  21. happy_bday(name)
RAW Paste Data