python基础学习笔记
程序员文章站
2022-06-15 18:43:08
...
标题 在一行加上‘\’,例如:
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'])
上面这一行的程序过长,换行续写如下:
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'])
如果是以逗号连接的,可以不加‘\’,例如:
datas1 = [data11, data21, data31, data41, data51, data61,
data71, data81, data91, data101, data111,data121,
data131,data141,data151,data161,data171,
data181,data191,data201,data211]
另注:
\ :连接当前行与下一行的字符
/ :除法
//:强行整除
%:取余