条件成立时的返回值 if 条件 else 条件不成立时的返回值
x = 10
y = 20
print(f"x if x > y else y: {x if x > y else y}")
x if x > y else y: 20
条件成立时的返回值 if 条件 else 条件不成立时的返回值
x = 10
y = 20
print(f"x if x > y else y: {x if x > y else y}")
x if x > y else y: 20
下一篇:072 迭代器
逻辑运算符 (短路与) && (逻辑与)& (短路或)|| (逻辑或)| (逻辑非)! (异或操作)^(短路与) && (逻辑与)&(短路与) &&&&具有短路功能,当&&左边表达式为false的时候
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M