Commit cfe44db6 by BellCodeEditor

save project

parent 31650f9d
Showing with 12 additions and 6 deletions
......@@ -7,10 +7,16 @@ def new_input():
else:
try:
unit=int(unit)
except:
print("你输入的不是数字,请输入数字!")
else:
total.append(unit)
except:
print("你输入的不是数字,请输入数字!")
else:
total.append(unit)
return total
def sum(list):
sump = 0
for i in list:
sump += i
return sump
price = new_input()
new_input()
\ No newline at end of file
sumprice = sum(price)
print(sumprice)
\ 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