[Tutor] printing items form list

Rafael Knuth rafael.knuth at gmail.com
Fri Mar 3 07:12:23 EST 2017

I want to print individual items from a list like this:

You have a book, towel, shirt, pants in your luggage.

This is my code:

suitcase = ["book", "towel", "shirt", "pants"]
print ("You have a %s in your luggage." % suitcase)

Instead of printing out the items on the list, my code appends the
list to the string. How do I need to modify my code?

== RESTART: C:/Users/Rafael/Documents/01 - BIZ/Python/Python Code/PPC_7.py ==
You have a ['book', 'towel', 'shirt', 'pants'] in your luggage.

More information about the Tutor mailing list