Sep-28-2021, 09:32 AM
Another way
names = [] counter = 1 while True: name = input('Enter Name: ') if name == 'q': break names.append(f'{counter}. {name}') counter += 1 for name in names: print(name)
Output:Enter Name: john
1. john
Enter Name: jane
1. john
2. jane
Enter Name: sue
1. john
2. jane
3. sue
Enter Name: bob
1. john
2. jane
3. sue
4. bob
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags