Commit 0989ceef by BellCodeEditor

auto save

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