(PYTHON)
Q9 (3 pts) Define a function: The function should accept the user name and age as input and output the lyrics to Happy birthday and counts from 0 to the user's age.
Desired output:
Happy Birthday to you!
Happy Birthday to you!
Happy Birthday, dear Friend
Happy Birthday to you!
Are you 1,
Are you 2,
Are you 3,
and so on,
Are you 29,
30! YAY!
def birthDayWish(name, age): print("Happy Birthday to "+name+"!") print("Happy Birthday to "+name+"!") print("Happy Birthday to " + name + ", dear Friend") print("Happy Birthday to " + name + "!") for i in range(1,age): print("Are you "+str(i)+",") print(str(age)+"! YAY!") # Testing birthDayWish("tom",10)
Get Answers For Free
Most questions answered within 1 hours.