Commit 3ed65248 by BellCodeEditor

auto save

parent c300b384
import swim
sum = swim.new_input()
some = swim.sum(sum)
print(some)
\ No newline at end of file
# import turtle
# def jht():
# t = turtle.Pen()
# for i in range(4):
# t.forward(100)
# t.left(90)
# jht()
def sanbin(x, y):
s = x+y
return s
skr = sanbin(123,456)
print(skr)
\ No newline at end of file
def new_input():
total = []
while True:
unit = input('请输入(q退出):')
if unit == 'q':
break
else:
try:
unit = int(unit)
except:
print("请输入一个数字")
else:
total.append(unit)
finally:
print("=================")
return total
def sum(a):
b = 0
for i in a:
b += i
return b
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