python-三元运算
if 3 == 3:
name = "nginx"
else:
name = "tomcat"
print(name)
# nginx
#######################
# 上边的判断句和下面的是一个意思
name = "nginx" if 3 == 3 else "tomcat"
print(name)
# nginx
我的目标是每天厉害一点点
if 3 == 3:
name = "nginx"
else:
name = "tomcat"
print(name)
# nginx
#######################
# 上边的判断句和下面的是一个意思
name = "nginx" if 3 == 3 else "tomcat"
print(name)
# nginx