7 Comments
User's avatar
⭠ Return to thread
Stephen Gruppetta's avatar

That's a great point. Yes, you can print the list directly but this will print it out in the form of a Python list, with the square brackets and quotation marks and commas and all that. If you're fine with that, that's great, but sometimes you want to display the items in some other form, without all the clutter of the list syntax (especially if it's an output for a non-Python audience). Unpacking allows you to do so…

And as you say, the `sep` parameter won't work if you print the list directly since you only have one object as argument for `print()` in this case, so there's nothing to separate

Expand full comment