scipiguy

Programming 102: Happy Birthday Function

Jun 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. from time import sleep
  2.  
  3. def happy_birthday(name):
  4.     for repeats in range(2):
  5.         print("Happy birthday to you")
  6.         sleep(1)
  7.     print("Happy birthday dear " + name)
  8.     sleep(1)
  9.     print("Happy birthday to you!")
  10.    
  11. happy_birthday("Fred")
Advertisement
Add Comment
Please, Sign In to add comment