58.0k views
1 vote
Does anyone know how to ask the user to input their name and then print the name 10 times using a while loop and have the 10 names on different lines?

User Akash Rao
by
4.4k points

1 Answer

5 votes

In python:

name = input("What's your name? ")

i = 0

while i <= 10:

print (name)

i += 1

I hope this helps!

User Yevgeniya
by
4.9k points