Commit b34f2c98 by BellCodeEditor

save project

parent 75cd0dad
Showing with 13 additions and 13 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
try: unit= input("请输入:")
unit=int(input("请输入:")) if unit== 'q':
except:
break
else:
if unit=="q":
break break
else: else:
total.append(unit) total.append(unit)
return(total) print(total)
def sum(a): return total
def sum(total):
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