Commit bd25e32a by BellCodeEditor

save project

parent 51945f1b
import func
list=func.new_input()
zg=func.sum(list)
print(zg)
\ No newline at end of file
/ def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请输入整数")
else: else:
total.append(unit) total.append(unit)
finally: finally:
print("*"*25) print("*"*25)
print(total) print(total)
return total return total
y = new_input() def sum(list):
print(y) s = 0
for i in list:
s = s + i
return s
# y = new_input()
# p = sum(y)
# print("您花了",p,"元,现金还是扫码")
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