标签:return for python 循环 [] int turn highlight [1]
li = [] for i in range(10): def f1(): return i li.append(f1) print(li[1]()) ‘‘‘循环x ,把x值添加到 前面x里面‘‘‘ li = [x for x in range(10)] print(li) ‘‘‘循环X 如果X大于5 就把X添加到前面X里面并且加10‘‘‘ li = [x+10 for x in range(10) if x > 5] print(li) ‘‘‘ 把X 添加到前面X 里面,‘‘‘ li = [lambda:x for x in range(10)] print(li[1]())
标签:return for python 循环 [] int turn highlight [1]
原文地址:http://www.cnblogs.com/cloniu/p/6344337.html