用户:
阿尔瓦雷斯查看:0 回复:0 评论:0 创建时间:2023-05-20T17:45:29
【作品展示】

【作品介绍】
求解:9行有错
谢
【作品源代码】
res=[]
for x in range(9):
if x==0:
res.append([1])
elif x==1:
res.append([1,1])
else:
l=[]
for y in range(len(res[x-1])):
if y==0:
l.append(1)
else:
l.append(res[x-1][y]+res[x-1][y-1])
l.append(1)
for x in res:
print(x)
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn