fork download
  1. # 欢迎光临本店
  2. goods = "笔记本"
  3. price = 15 #商品单价
  4. money = 20 #顾客的钱
  5.  
  6. print("==== 小店购物 ====")
  7. print(f"商品:{goods},单价:{price}元")
  8. print(f"你身上有{money}元")
  9.  
  10. if money >= price:
  11. print("钱足够。")
  12. else:
  13. print("钱不够。")
  14.  
Success #stdin #stdout 0.02s 9160KB
stdin
Standard input is empty
stdout
==== 小店购物 ====
商品:笔记本,单价:15元
你身上有20元
钱足够。