Vahid2015
0
Q:

format multi line string python

# String containing newline characters
line_str = "I'm learning Python.\nI refer to TechBeamers.com tutorials.\nIt is the most popular site for Python programmers."
print("Long string with newlines: \n" + line_str)

# Creating a multiline string
multiline_str = """I'm learning Python.
I refer to TechBeamers.com tutorials.
It is the most popular site for Python programmers."""
print("Multiline string: \n" + multiline_str)
0

New to Communities?

Join the community