How can I do a line break (line continuation) in Python?

In Python, you can use the "\" character to indicate a line continuation. For example:

x = 1 + 2 + 3 + \
    4 + 5 + 6
print(x)

You can also use parentheses, brackets, or braces to indicate a line continuation. For example:

x = (1 + 2 + 3 +
     4 + 5 + 6)

y = [1, 2, 3,
     4, 5, 6]

z = {1: "one",
     2: "two"}
print(x)
print(y)
print(z)

Watch a course Python - The Practical Guide

Another way is to use an explicit line joining operator (;)

x = 1 + 2 + 3 ; print(x)

You can also use triple quotes """ or '''

x = """
This is a
multi-line string
"""
print(x)