一、if语句的使用
Python条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块。
if 判断条件:
执行语句……
else:
执行语句……
age=45
if age > 18:
print('yes')
else:
print('none')
#输入身上金额和年龄,若年龄大于18岁就可以上网,若成年且大于2000就可以进入会所。
age=float(input("输入年龄:"))
money=float(input('输入金额:'))
if age>=18:
print('可以上网')
if money>=2000:
print('可以进入会所')
else:
print('/')
else: