Commit 9cb5309f by BellCodeEditor

save project

parent 884817e7
import func
dance=func.new_input()
scroce=func.sums(dance)
print(scroce)
\ No newline at end of file
...@@ -15,7 +15,7 @@ def new_input(): ...@@ -15,7 +15,7 @@ def new_input():
print("=====================") print("=====================")
return total return total
# 创建函数sum放入参数money # 创建函数sum放入参数money
def sum(money): def sums(money):
# 设置变量count # 设置变量count
count=0 count=0
# 遍历列表 # 遍历列表
...@@ -26,7 +26,7 @@ def sum(money): ...@@ -26,7 +26,7 @@ def sum(money):
return count return count
price = new_input() #price = new_input()
# 调用函数sum并赋值给pay # 调用函数sum并赋值给pay
pay=sum(price) #pay=sum(price)
print("您一共消费了" + str(pay) + "元!扫码还是现金呢?") #print("您一共消费了" + str(pay) + "元!扫码还是现金呢?")
\ No newline at end of file \ 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