Commit 375f56c1 by BellCodeEditor

save project

parent 1bf6786e
Showing with 15 additions and 20 deletions
#total = []
#def caidan():
# while True:
# unit= input("请输入:")
# if unit== 'q':
# break
# else:
# total.append(unit)
#caidan()
#print(total)
#try:
# a=input("请输入")
# b=a/2
#except:
# a=int(input("请重新输入"))
# print(a/2)
def add(a,b):
return a+b
print(add(1,2))
\ No newline at end of file
def caidan():
total=[]
while True:
unit= input("请输入价格")
if unit=='q':
break
else:
try:
unit=int(unit)
except:
continue
total.append(unit)
return total
print(caidan())
\ 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