Commit 84749c15 by BellCodeEditor

save project

parent 05e7d622
def x(a):
d=0
for i in a:
d+=i
return d
def totl():
total = []
while True:
unit= input("请输入价格:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("你输入的不是整数")
else:
total.append(unit)
return total
a=totl()
print(a)
import func
p=func.totl()
q=func.x(p)
print(q)
\ 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