python if语句 案例 案例:打车费用计算 #输入公里数: num = int(input("输入公里数:")) #判断公里数是否小于2km,如果小于2 那就是起步价8元 if num <= 2 : price = 8 print("您需要支付:%.1f"