Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python write string in multiple lines

# Python multiline string example using brackets
multiline_str = ("I'm learning Python. "
"I refer to TechBeamers.com tutorials. "
"It is the most popular site for Python programmers.")
print(multiline_str)

# For f-strings, use an f before each part
numbers = [0,1,2]
multiline_str = (f"{numbers[0]}I'm learning Python. "
f"{numbers[1]}I refer to TechBeamers.com tutorials. "
f"{numbers[2]} It is the most popular site for Python programmers.")
print(multiline_str)
Source by www.techbeamers.com #
 
PREVIOUS NEXT
Tagged: #python #write #string #multiple #lines
ADD COMMENT
Topic
Name
6+4 =