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

long_string = confusion

I am trying to follow the video in my workspace but when I get to:

long_string = "Here's a new line:

I get stuck because I do not know how to get to the next line without submitting everything. Then of course I get a syntax error. I am completely new to programming and this reads as a beginners course but small frustrations like this are frequent.

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,468 Points

To enter a multiline string use a triple quote:

long_string = """Here's a new line:
Other line
One more
"""

Thanks so much. I actually heard Kenneth say it right after I posted this. I really appreciate the quick answer though!

For multiline string use triple quote:

long_string = " " " first line second line third line and so forth " " "