Commit 17b5b9da by BellCodeEditor

save project

parent 8c7c75e0
Showing with 16 additions and 4 deletions
import func
data = func.new_input()
data = func.sum(data)
print("这位选手的总分数为:"+str(score))
\ No newline at end of file
...@@ -10,11 +10,17 @@ def new_input(): ...@@ -10,11 +10,17 @@ def new_input():
except: except:
print('请重新输入一个数字') print('请重新输入一个数字')
else: else:
total.append(money) total.append(unit)
finally: finally:
print('-'*30) print("====================")
return total return total
def sum(money):
count = 0
for i in money:
count = count + i
return count
price = new_input()
pay = sum(price)
print("您一共消费了" + str(pay)+ "元!扫描还是现金呢?")
result = new_input() result = new_input()
print(result) print(result)
\ 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