一:嵌套if
语法结构:
if 条件表达式1:
if 内存条件表达式:
内存条件执行体1
else:
内存条件执行体2
else:
条件执行体
answer=input('您是会员吗?y/n')
money=float(input('请输入购物金额'))
if answer=='y':
if money>=200:
print('打八折,付款金额为:',money*0.8)
elif money>=100:
print('打九折,付款金额为:',money*0.9)
else:
print('不打折,付款金额为:',money)
else:
if money>=200:
print('打九点五折,付款金额为:',money*0.95)
else:
print('不打折,付款金额为',money)
二pass语句
什么都不做,只是一个占位符,用到需要写语句的地方