Commit cc8f4700 by BellCodeEditor

auto save

parent df278000
def a(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:") money= input("请输入:")
if unit== 'q': if money== 'q':
break break
else: else:
try: try:
unit = int(unit) money = int(money)
except: except:
print('重输一个数字') print('重输一个数字')
else: else:
total.append(unit) total.append(money)
print("*"*30) finally:
print("*"*30)
return total 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