Commit eb9124a8 by BellCodeEditor

save project

parent 542ff63e
def newinput():
a=[]
while True:
f=input("请输入:")
if f=="q":
break
else:
try:
f=int(f)
except:
print("数字")
else:
a.append(f)
finally:
print("_"*30)
return a
def sum(money):
count=0
for i in money:
count=count+i
return count
# p=newinput()
# w=sum(p)
# print("一共消费"+str(w)+"元")
\ No newline at end of file
import func
i=func.newinput()
g=func.sum(i)
print("总分"+str(g))
\ 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