def pay(x):
(Tab缩进)return 9*x#此处可改单价
if __name__ == "__main__":
(Tab缩进)ask=float(input("输入苹果重量(单位:斤):"))
(Tab缩进)print(f"购买了{ask}斤苹果,待付款:{pay(ask)}元")
fruits=["猕猴桃",125,"苹果",315,"香蕉",80,"草莓",50,"葡萄",70,"砂糖橘",200]prices=[15,8,5,30,12,6]
all_listx=fruits+prices
for x in range(1,12,2):
if all_listx[x] <100:
print(all_listx[x-1])
望采纳
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)