python中的;

很多人在学过java的人,在学python时会对缩进表示逻辑感到非常难受,但实际上python也是支持 ; 表示逻辑的
示例如下

x=2 y=x-2 print(x,y)

在不加;时直接报错

x=2;y=x-2;print(x,y)

加了后就正常了

猜你喜欢

转载自blog.csdn.net/m0_49040755/article/details/120863151