Commit cc8f4700 by BellCodeEditor

auto save

parent df278000
def a():
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
money= input("请输入:")
if money== 'q':
break
else:
try:
unit = int(unit)
money = int(money)
except:
print('重输一个数字')
else:
total.append(unit)
print("*"*30)
total.append(money)
finally:
print("*"*30)
return total
b=a()
print(b)
def sum(uoit):
count=0
for i in uoit:
count=count+i
return count
# abc = new_input()
# cba = sum(abc)
#result = new_input()
# print("您一共消费了"+str(cba)+"元,请问是支付还是扫码?")
import random
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