编写代码时,一行太长写不下该如何换行继续输入呢?一起来看下python如何换行继续输入吧!
python如何换行继续输入
python换行继续输入的方法:大理石检验平板
1、在一行末尾加上‘’,例如:
1
|
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' ])
|
上面这一行的程序过长,换行续写如下:
1
2
3
4
|
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、如果是以逗号连接的,可以不加‘’,例如:
1
2
3
4
|
datas1 = [data11, data21, data31, data41, data51, data61,
data71, data81, data91, data101, data111,data121,
data131,data141,data151,data161,data171,
data181,data191,data201,data211]
|
另注:
:连接当前行与下一行的字符
/ :除法
//:强行整除
%:取余