Commit b3aed780 by BellCodeEditor

save project

parent 3a5c01b0
Showing with 14 additions and 7 deletions
unit=0 unit=0
i=0 i=0
def A(qw): def A():
total = [] total = []
while True: while True:
unit=input("请输入:") unit=input("请输入:")
...@@ -13,9 +13,16 @@ def A(qw): ...@@ -13,9 +13,16 @@ def A(qw):
print("请输入整数") print("请输入整数")
else: else:
total.append(unit) total.append(unit)
for q in qw:
i+=q
return i
return total return total
qwe=to def you_can(money):
A(total) wq=0
\ No newline at end of file for i in money:
wq=wq+i
return wq
print("請輸入價格,按‘q’退出")
x=A()
y=you_can(x)
z=str(y)
print("您的花費為:")
print(z+"元")
print("祝您用餐愉快!")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment