Python Python Basics (2015) Python Data Types Strings

Patrik Karlsson
PRO
Patrik Karlsson
Pro Student 436 Points

why do i get \n for every return i press when trying to make the long_string example in my workspace?

I tried to follow along with the video and make the long_string example?

Jennifer Nordell
Jennifer Nordell
Treehouse Staff

Are you following along in Workspaces or some other IDE? :sparkles:

3 Answers

Allison Schaaf
Allison Schaaf
33,295 Points

Assign the string to a variable and then use print().

Haydar Al-Rikabi
Haydar Al-Rikabi
5,970 Points

Use the print() function to parse new lines \n in your string.

print("""hello 

world""")

or

message = """hello 

world"""
print(message)