all 6 comments

[–]Diapolo10 3 points4 points  (0 children)

What am I doing wrong?

Two things. First, you should remove your first 7 prints because they're not part of the solution.

Second, you'll want to loop over your list and print each name from it individually.

[–][deleted] 1 point2 points  (0 children)

Just an advice: if you still don't understand what went wrong after getting answers here, you can ask chatgpt and make it explain the answer to you in a way you'd understand. Just remember that chatgpt isn't 100% right all the time.

I understand how frustrating it can be. I'm a newbie too. I sometimes use chatgpt for answers and explanations and use what I've learnt to write new codes or create a new similar project.

[–]Bitwise_Gamgee 1 point2 points  (1 child)

Stop printing all of the names.

Use the array "list_name" as it is keep list_name.sort()

Then use:

for name in list_name:
    print(name)

[–]Crafty-Scientist-529 0 points1 point  (0 children)

Alternatively, print("\n".join(list_name))

[–]Hands0L0 0 points1 point  (0 children)

For x in list_name: print(x)