Home  >  Article  >  Backend Development  >  How to wrap line and continue typing in python

How to wrap line and continue typing in python

angryTom
angryTomOriginal
2020-03-03 11:21:5017606browse

When writing code, if a line is too long to write, how can I change the line and continue typing? Let’s take a look at how to wrap lines in python and continue typing!

How to wrap line and continue typing in python

How to continue typing with a new line in python

How to continue typing with a new line in python:

1. At the end of a line Add '\', for example:

data11=data21=data31=data41=data51=data61=data71=data81=data91=data101=data111=data121=data131=data141=data151=data161=data171=data181=data191=data201=data211=pd.DataFrame(columns['w','ka','period'])

The above line of program is too long, change the line and continue as follows:

Recommended: "Python Video Tutorial"

data11=data21=data31=data41=data51=data61=data71=data81\
=data91=data101=data111=data121=data131=data141\
=data151=data161=data171=data181=data191=data201=data211\ 
= pd.DataFrame(columns=['w','ka','period'])

2. If it is connected with a comma, you can not add '\', for example:

datas1 = [data11, data21, data31, data41, data51, data61, 
data71, data81, data91, data101, data111,data121,
data131,data141,data151,data161,data171,
data181,data191,data201,data211]

Another note:

\: The character that connects the current line and the next line

/: Division

//: Forced division

%: Remainder

PHP Chinese website, a large number of free python video tutorials and related programming videos Tutorial, welcome to learn!

The above is the detailed content of How to wrap line and continue typing 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