Home  >  Article  >  Backend Development  >  How to wrap lines when writing in python

How to wrap lines when writing in python

silencement
silencementOriginal
2019-05-17 11:40:0646971browse

The code in Python is usually written in one line, but if you can’t finish writing in one line, how can you continue writing in a new line?

How to wrap lines when writing in python

Code line breaks in python are divided into two situations

1. Direct line breaks in the code: spaces\

How to wrap lines when writing in python

2. Add brackets, () {} [] do not need to add special line breaks

How to wrap lines when writing in python

#3. There is also a new line break in a string that is similar to code line break. You must use triple quotes to achieve this purpose (single/double can be used) , this method can output the newline character in the string without string concatenation \n.

How to wrap lines when writing in python

The above is the detailed content of How to wrap lines when writing in python. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more