Commit df7ed05c by BellCodeEditor

auto save

parent 578e41ee
import func
a=func.new_input()
b=func.sum_a(a)
print(b)
\ No newline at end of file
total = [] def new_input():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
else: break
total.append(unit) else:
print(total) try:
\ No newline at end of file price=int(unit)
except:
print("输入整数哦")
else:
total.append(price)
print(total)
return total
def sum_a(list_a):
sumnum=0
for i in list_a:
sumnum+=i
return sumnum
# a=new_input()
# b=sum_a(a)
# print(b)
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