Commit 2a2e94d5 by BellCodeEditor

auto save

parent 578e41ee
Showing with 39 additions and 9 deletions
# def func(x,y):
# s=x+y
# return s
# z=func(4,3)
# print(z)
# def func(x,y):
# if x>y:
# return x
# else:
# return y
# z=func(4,9)
# print(z)
def func(n):
sum1=0
for i in range(n+1):
sum1 += i
return sum1
aa=func(5)
print(aa)
\ No newline at end of file
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print()
else:
total.append(unit)
#print(total)
return total
list1=new_input()
print(list1)
\ 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