list comprehension

pythonのリストに複数の番地を指定して要素を取り出す

a = list([4,5,3,2,7]) banchi = [3,0] [a[i] for i in banchi] 3番地と0番地の値の2と4が返る [2, 4]