> On Mar 3, 2017, at 12:52, Peter Otten <__pete...@web.de> 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
da...@graniteweb.com




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to