S
S
sportik1742021-08-10 15:22:57
Python
sportik174, 2021-08-10 15:22:57

How to write a string to a wrap variable in Python?

Hello!
How to write a string in a variable in multiple lines for convenience?

Not like this: But like this:
string = "Строка в переменной"

string = "
      Строка 
      в переменной
"


It is clear that the example simplified. Alternatively, the line can contain HTML code, for example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-08-10
@sportik174

Wrapped in triple quotes

string = """
      Строка
      в переменной
"""

Or dividing through\
string = "Строка " \
      "в переменной"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question