Commit 8318d79e by BellCodeEditor

save project

parent 05e7d622
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):
c=0
for i in m:
c=c+i
return(c)
\ No newline at end of file
import a
data=a.new_input()
s=a.sum(data)
print(s)
\ No newline at end of file
with open(r'c:\Users\ASUS\Desktop\新建文本文档.txt','r',encoding='utf-8')as f:
for i in f:
print(i)
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