'''坐公交案例
坐公交车:有钱可以上车,没钱不能上车。
上车如果有空,可以座1.是否有钱2.有空座位3.
'''
a1 =2
b =int(input('您现在口袋有多少钱:'))
a2 =30
if b >= a1:
b2 =int(input('现在车上有多少人'))
print(f'您有{b}钱,可以上公交')
if b2>a2:
print('对不起没有座位了,请站在吧')
else:
print(f'还有{a2-b2}个座位,请坐下吧')
else:
print('没带钱,跟着跑起来')
###
moneny =1
seat =1
if moneny ==1:
print('土豪,请上车')
#判断是否有空座
if seat ==1:
print('有空位,请坐下')
else:
print('没有座位,站着吧')
else:
print('没带钱,跑起来吧')
网友评论