Commit d3bf0689 by BellCodeEditor

save project

parent 05e7d622
Showing with 49 additions and 0 deletions
def A():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
try:
b=int(unit)
except:
print("写数字")
else:
total.append(unit)
#print(total)
return total
t=A()
print(t[1])
def a():
def a():
t=[]
while True:
u=input("请输入(输入q退出):")
if u == 'q':
break
try:
b=int(u)
except:
print("请输入数字!")
else:
t.append(u)
return t
t=a()
x=0
z=0
while True:
z=z+int(t[x])
x=x+1
if x==len(t):
break
print("您一共用了"+str(z)+"元?")
\ 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