Commit 0989ceef by BellCodeEditor

auto save

parent b1e1033d
Showing with 11 additions and 28 deletions
def e(): import func
total = [] data = func.e()
while True: score = sum(data)
unit= input("请输入:") print(sum)
if unit== 'q': \ No newline at end of file
break
else:
try:
unit=int(unit)
except:
print("请重新输入一个数字:")
else:
total.append(unit)
print("-"*30)
return total
result=e()
print(result)
sum=0
for i in range(len(result)):
sum=sum+result[i]
print("您需要付的总价:"+str(sum))
\ No newline at end of file
import random
def e(): def e():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入这位选手的分数:")
if unit== 'q': if unit== 'q':
break break
else: 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)
...@@ -16,6 +17,7 @@ def e(): ...@@ -16,6 +17,7 @@ def e():
result=e() result=e()
print(result) print(result)
sum=0 sum=0
a=0
for i in range(len(result)): for i in range(len(result)):
sum=sum+result[i] sum=sum+result[i]
print("您需要付的总价:"+str(sum)) print("这位选手的分数是"+str(sum))-
\ 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