When to use \ in the print code?


#1

https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/string-formatting-with--part--1?action=resume_content_item

Why is there a \ in the code? We didn’t learn about this within the lesson.


#2

\ is known as the continuation operator when it appears in the last character position before a line break.

print "Pretend this is a very \
long sentence that needs to be \
broken up in order to be readable \
in code form without scrolling right."

When rendering (parsing), the line breaks are ignored.