关于作者

Discuss / Python / 感觉写得很菜

感觉写得很菜

问题来源

回头的犀牛

#1 Created at ...

def YangTriangles(max): n=1 b=[1,] while n<=max: yield b b.append(1) if n>1: i=n-1 while i>0: b[i]=b[i-1]+b[i] i=i-1 n=n+1 return 'done'

b=YangTriangles(10) for n in b: print(n)


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.