Home >Backend Development >Python Tutorial >How to wrap line and continue typing in python
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 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!