Commit f5c9b3e1 by BellCodeEditor

auto save

parent 7eaed43a
Showing with 31 additions and 0 deletions
def d():
a=[]
while True:
try:
b=int(input("价格:"))
except:
print("请输入一个整数!")
else:
if b==0:
break
else:
a.append(b)
return a
a=d()
print(a)
x=0
for i in range(len(a)):
z=a[i]
x=x+z
print(x)
total = []
def a():
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
a()
\ 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