Python Python Basics (2015) Python Data Types Strings

Python """ quote question

Hi just a quick question. When using the triple quote python is suppose to leave the empty space when printing out in the console but I receive a weird looking result instead

"""Here is some text
... With some space between !"""
'Here is some text \n\n\nWith some space between !'

As you can see I receive some \n\n\n instead of the actual space !

2 Answers

Christopher Shaw
Christopher Shaw
Python Web Development Techdegree Graduate 58,232 Points

The \n is the new line string character. So instead of the console if you assign the input to a variable:

text = """some text

last line"""

see the difference between unformatted


and formatted


I got it, if you code below to your console, it won't show \n any more print(text)

if you only type text, it will have \n