i just started programming in Python and i'm trying to do a program that prints names n times through a while loop, the condition is when the user input yes the program keeps adding n names to a list, if the users inputs something else it simply prints all the elements added in the list
eg: list_input = "Enrique"
count = 3 #Times
lista = ['Enrique', 'Enrique', 'Enrique']
def nameTries():
list_input = input("Enter the name:")
lista = []
count = int(input("How many times you want to repeat it?"))
lista.append(f'{list_input * count}')
confirm = input("Wanna add more? yes/no")
while confirm == "yes":
list_input = input("Enter the name:")
count = int(input("How many times you want to repeat it?"))
lista.append(f'{list_input * count}')
confirm = input("Wanna add more? yes/no")
if confirm != "yes":
print(lista)
break
else:
print(lista)
the problem is it's adding ONLY in an element of the list like this:
>>>['EnriqueEnriqueEnrique']
how can i solve this? Thanks in advance.