python入门练习题 3.坐公交
'''
1、坐公交,有钱money就上车,没钱就跑步回家
2、系统随机判断有没有坐位seat,有就坐,没有就站着
'''
# coding = utf-8
import random # 导入随机
money = int(input("你有多少钱:"))
seat = random.randint(0,1)
if money >= 3:
print(f"您给{money}元钱,找您{money-3}元,这是您的车票,请拿好!")
if seat == 0:
print("现在没位子,您站着等会!")
elif seat == 1:
print("这有位子,您到这时有坐!")
else:
print("你钱不够,跑步回家吧!")
浙公网安备 33010602011771号