python基础(1-18)

 

   bandWitch   、band_witch

 

 

 

 

 

 

# 列表推导式
alist = [ i*i for i in range(1,11) if i%2==1]
print(alist)
# [1, 9, 25, 49, 81]
# 字典推导式
adict = { i:2 for i in ["a","b"]}
print(adict)
# {'a': 2, 'b': 2}

 

posted on 2019-05-28 16:59  wzc521  阅读(73)  评论(0)    收藏  举报

导航