Hi! I'm trying to print a list that contains names and when it prints the items in the list all print on the same line. What I want is for each name to print on its own line.
For example this is what I get:
Smith, John Reilly, James Sykes, Matt
What I want is this:
Smith, John
Reilly, James
Sykes, Matt
The names come from user input by the way.
This is my code to print the list:
For example this is what I get:
Smith, John Reilly, James Sykes, Matt
What I want is this:
Smith, John
Reilly, James
Sykes, Matt
The names come from user input by the way.
This is my code to print the list:
Code:
visitors.sort() print ' '.join(visitors)
Comment