> On Mar 3, 2017, at 12:52, Peter Otten <[email protected]> wrote:
>
> Antonio Zagheni via Tutor wrote:
>
>> suitcase = ["book, ", "towel, ", "shirt, ", "pants"]
>
> Hm, looks like you opened Rafael's suitcase while he wasn't looking, and
> sneaked in some commas and spaces ;)
>
> That's cheating...
yeah, just a little. :-)
You can use join for this:
suitcase = ["book", "towel", "shirt", "pants"]
output = ', '.join(suitcase)
print ("You have a %s in your luggage.") %output
—
David Rock
[email protected]
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor