Which key to press for line break in python

anonymity
Release: 2019-06-14 09:50:55
Original
11982 people have browsed it

Which key to press for line break in python?

Which key to press for line break in python

Add '\' at the end of a line, 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'])

Above This line of program is too long. Please wrap the line and continue writing as follows:

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'])
Copy after login

If connected by commas, you don’t need to 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]
Copy after login

For example:

>>> print 'aaa'; \
... print 'bbb'; \
... print 'ccc'
Copy after login

Note the use of ;. Python itself does not require the ; sign at the end of statements and intervals, but it must be used when breaking a line. The last line is not required to have a ; sign, and there will be no error if added.

Another note:

\: Characters connecting the current line and the next line

/: Division

//: Forced integer division

%:Remainder

The above is the detailed content of Which key to press for line break in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!