Commit 75cd0dad by BellCodeEditor

auto save

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