I'm learning Python and usage of the stackoverflow so that's why this question might be trivial for you.
So; Code goal is to ask user names until user press enter. After that code should count how many names were given and then print list of the names.
Example
Enter a name:Jack
Enter a name:Dack
Enter a name:Nack
Enter a name:
Name count 3
Jack, Dack, Nack
I have created While true loop for name counting, but now I just can figure out how to simply print those names like in the above.
My code is:
count_names = 0
while True:
given_names = input("Enter a name: ")
if given_names == "":
print(f"Name count {count_names}")
break
count_names += 1
Result for that is:
Enter a name:Jack
Enter a name:Dack
Enter a name:Nack
Enter a name:
Name count 3
I can feel that the answer is right there but I just can't put my finger on it =/
Thanks again for the help.