+ 1
Exam question
How would I write A algorithm that asks for users age (years) then prints the message ‘happy birthday’ that many times.
4 Réponses
0
age=int(input())
while age>=0:
print("Happy Birthday")
age-=1
+ 1
#Promting user to enter their age
age = int(input("Enter your age: "))
#For age number of times print
for x in range(age):
print("Happy Birthday!")
+ 1
Thank you so much
0
Welcome!