Python Programming For Beginners: Crash Course (Java, Python, C++, R, C) (Programming, Java Programming, C++ Programming, Python Programming, R Programming, C Programming, Book 2) by Martin Laredo

Python Programming For Beginners: Crash Course (Java, Python, C++, R, C) (Programming, Java Programming, C++ Programming, Python Programming, R Programming, C Programming, Book 2) by Martin Laredo
Author: Martin Laredo
Language: eng
Format: azw3, epub
Publisher: Martin Laredo Publishing
Published: 2016-12-02

Print

I do not want to see brackets around everything when I am using a program. Instead, I would rather see a clean list so that I do not have to work at figuring out what the list says. To do this, I am going to use the join method.

Example

Example: 1recent_books = ['To Kill a Mockingbird', 'Slaughterhouse Five', 'East of Eden']

2print 'The three most recent books I’ve read are: %s.' % ', '.join(recent_books)

3# prints 'The three most recent books I’ve read are: To Kill a Mockingbird, Slaughterhouse Five, East of Eden.