zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Python条件判断的缩写方法

Python方法 判断 条件 缩写
2023-06-13 09:14:02 时间
return(1==1)?"iseasy":"mygod"//C#中的用法
其实,在Python中,是这样写的:
print(1==2)and"Fool"or"Notbad"
输出结果:
Notbad