Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Silly Question: How to write paragraphs.... but weirder.

Hey Pythonisimos, Weird question: I am writing a longer piece of Print-able verbiage, something I want the user to see as a list. I used \n to make the list appear properly when it prints out. But now I have a stupid-long line of stuff that I have to look at behind the scenes.

Is there a way to make it look pretty on my end without getting an EOL Error?

Steven Parker
Steven Parker
229,644 Points

It's not clear what's causing the error from the description. Can you post the code (formatted with Markdown)?

1 Answer

Kirstin Kleyn
Kirstin Kleyn
870 Points

You can wrap the next in triple quotation marks (''' ''') and then write out the list as you would like to see it printed. If you press enter in the list, it will appear on a new line when printed out.

i.e. print('''This is a long long list.''')

Will print as:

This is a long long list.


I hope this is what you were looking for!