Commit 4e17d459 by BellCodeEditor

save project

parent 4522d1ca
def new_input():
t=[]
while True:
u=input("输入q")
break
else:
try:
u=int(u)
except:
print("输入数字")
else:
t.append(u)
finally:
print("===========================")
return t
def sum(m): def sum(m):
c=0 c=0
for i in m: for i in m:
......
import a
data=a.new_input()
s=a.sum(data)
print(s)
\ No newline at end of file
def new_input():
t=[]
while True:
u=input("输入q")
if u == "q":
break
else:
try:
u=int(u)
except:
print("输入数字")
else:
t.append(u)
finally:
print("===========================")
return t
def sum(m):
c=0
for i in m:
c=c+i
return(c)
\ 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