【廖雪峯Python習題集】生成器

楊輝三角定義以下:python 1app 1 1code 1 2 1blog 1 3 3 1utf-8 1 4 6 4 1input 1 5 10 10 5 1generator 把每一行看作一個list,試寫一個generator,不斷輸出下一行的list:class #_*_coding:utf-8_*_ def triangles(n): L=[] for i in rang
相關文章
相關標籤/搜索