Commit 2a2e94d5 by BellCodeEditor

auto save

parent 578e41ee
Showing with 34 additions and 4 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 = [] def new_input():
while True: total = []
while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
try:
unit=int(unit)
except:
print()
else:
total.append(unit) total.append(unit)
print(total) #print(total)
\ No newline at end of file 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