Commit eeb6b25a by BellCodeEditor

save project

parent 67ea7b61
Showing with 15 additions and 31 deletions
def a():
total = []
while True:
unit=input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请输入数字:")
else:
total.append(unit)
finally:
print("-"*30)
return total
def sum(money):
count=0
for i in money:
count=count+i
return count
# price=a()
# pay=sum(price)
#print("您一共消费了"+str(pay)+"元")
import turtle
a=turtle.Pen()
a.pensize(10)
a.penup()
a.goto(-50,100)
a.pendown()
a.pencolor("red")
a.right(90)
a.fd(200)
a.left(90)
a.pencolor("blue")
a.circle(100,180)
a.hideturtle()
turtle.done()
\ No newline at end of file
import func
d=func.a()
s=func.sum(d)
print("这位选手的总分数为:"+str(s))
\ 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