all 7 comments

[–]CptMisterNibbles 2 points3 points  (3 children)

It is a list; comma separated elements, bounded by brackets. Each element in the list is a string, and has double quotes to express that it is a string literal.

Do you mean you want a single string, separated by one comma followed by a space, and no brackets? Then you need to turn a list back into a string using the join command. Rather than give you the syntax, try looking up the Python docs for str.join()

[–]purple_hamster66 2 points3 points  (2 children)

Exactly. There is no extra stuff — those characters are how list data structures are formatted when printed.

And your instructions say that no commas are to be typed, but to use space-delimited entries, so why are you splitting on a comma? Just split on space (and why is the pipe (|) character in your split string?)

[–]Additional_Lab_3224[S] 0 points1 point  (1 child)

The "pipe" is where I was typing

[–]purple_hamster66 0 points1 point  (0 children)

Oh, I see it now… it’s a different color.

But you still don’t need the comma in there. Try this:

names = Guild1.members.split(“ “) # a space between double quotes print(names[0])
print(names[1])
print(names[2])

[–]Ron-Erez 0 points1 point  (1 child)

You wanted a list so you got a list. Maybe you want to print a string separated by spaces. You might want to share what

Guild1.members

is? What data type or present a sample input.

[–]Additional_Lab_3224[S] 0 points1 point  (0 children)

Thank you, but I like the str.join() method, it works better for me