摘要: data = [[col for col in range(4)] for row in range(4)]'''[0,1,2,3][0,1,2,3][0,1,2,3][0,1,2,3] [0,0,0,0][1,1,1,1][2,2,2,2][3,3,3,3]'''for r_index,row i 阅读全文
posted @ 2018-01-17 23:55 Panpy_Y 阅读(878) 评论(0) 推荐(0) 编辑
摘要: #例1装饰器def w1(main_func): def outer(request,kargs): print('before') main_func(request,kargs) print('after') return outer @w1def show(): print('show') # 阅读全文
posted @ 2018-01-17 01:24 Panpy_Y 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #递归实现def calc(n): print(n) if n/2 >1: res = calc(n/2) print('res:',res) print('N:',n) return n calc(100) #斐波那契数列def func(arg1,arg2,stop) if arg1 == 0: 阅读全文
posted @ 2018-01-17 01:21 Panpy_Y 阅读(226) 评论(0) 推荐(0) 编辑