176k views
5 votes
Grandma Ester normally bakes you cookies for your birthday - one for every year old you are. When you turned 15, she made you 15 cookies! This year, she, unfortunately, cannot see you on your birthday, so instead, she wants to send you virtual cookies!

Create a program that prompts the user for how old they are turning, and then, using a loop, outputs a virtual cookie for every year old they are.

The following prints a single “virtual cookie.”

print("(::)")

User DrAlberT
by
5.0k points

1 Answer

6 votes

Answer: Written in Python

age = int(input("How old are you? "))

for i in range(1,age+1):

print("**HUG**")

Step-by-step explanation:

The first line prompts the user for age

age = int(input("How old are you? "))

The next line is an iteration that starts from 1 till the user input

for i in range(1,age+1):

The last line prints "**HUG**" while the iteration is true

print("**HUG**")

Hope this helps :)

User Jeff Schmitz
by
5.6k points