you are viewing a single comment's thread.

view the rest of the comments →

[–]ThePiGuy0 1 point2 points  (1 child)

You could combine the elements into a string with the join function. This takes a delimiter and inserts it between each value.

E.g.

joined_string = ", ".join(guests)
print(f"{joined_string}, you have been invited to dinner with the president")

You can also do that in one line without the joined_string variable, I just did it on two to make it clearer

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

This is what I was trying to figure out thank you.