Commit b34f2c98 by BellCodeEditor

save project

parent 75cd0dad
Showing with 14 additions and 14 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
try: unit= input("请输入:")
unit=int(input("请输入:")) if unit== 'q':
except:
break break
else: else:
if unit=="q": total.append(unit)
break print(total)
else: return total
total.append(unit) def sum(total):
return(total)
def sum(a):
count=0 count=0
for i in a: for i in total:
count=count+i count=count+int(i)
new_input() print(count)
#sum(new_input()) return count
\ No newline at end of file sum(new_input())
\ 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