Commit 62666298 by BellCodeEditor

save project

parent 28416401
Showing with 12 additions and 10 deletions
alist = [88, 75, 72, 82, 90, 85, 78, 91]
n=len(alist)
for in range(n-1)
for in range(n-1)
if alist[j]>alist[j+1]:
t=alist[j]
alist[j]=alist[j+1]
alist[j+1]=t
print(alist)
\ No newline at end of file
#定义一个函数sum_numbers()
#要求这个函数能接收一个名为num的整型参数
#要求这个函数能计算1+2+3+……+num的结果
def sum_nuber(num):
if num==1:
return 1
else:
t=sum_nuber(num-1)+num
return t
r=sum=nuber
print(r)
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