Commit d81eb52d by BellCodeEditor

save project

parent 05e7d622
Showing with 28 additions and 0 deletions
price=[15,18,14,25]
he=0
for i in price:
he=he+i
print(he)
\ No newline at end of file
def diancai():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
try:
int(unit)
except:
print('要输入整数')
else:
total.append(unit)
x=0
for i in total:
x=x+int(i)
print(x)
return x
diancai()
\ 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