Commit be215ee7 by BellCodeEditor

save project

parent e34188fa
Showing with 29 additions and 11 deletions
...@@ -4,13 +4,23 @@ def new_input(): ...@@ -4,13 +4,23 @@ def new_input():
unit= input("请输入:(按q退出)") unit= input("请输入:(按q退出)")
if unit=='q': if unit=='q':
break break
elif : else:
try: try:
unit = int(unit) unit = int(unit)
except: except:
print("输入有误!请输入。") print("输入有误!请输入。")
else: else:
total.append(unit) total.append(unit)
print("-"*30) print("-"*30)
return total return total
new_input() new_input()
\ No newline at end of file
def sum(money):
count = 0
for i in money:
count = count + i
return count
#price = new_input
#pay = sum(price)
#print("您一共消费了"+str(pay)+"元!扫码还是现金?")
\ No newline at end of file
import func
data = func.new_input()
score = func.sum(data)
print("这个选手的总得分是"+str(score))
\ 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