###まずは通常のリスト作成
list_1 = [] for i in range(10): list_1.append(i) list_1
リスト内包表記 simple
list_2 = [i for i in range(10)] list_2
文字列リストver
countries = np.array(['France','Japan','USA','Russia','USA','Mexico','Japan']) list_3 = [country for country in countries] list_3
文字列リストver(重複削除のおまけつき)
list_4 = [country for country in np.unique(countries)] list_4
if文ありver
list_5= [i for i in range(10) if i % 2 == 0] list_5
if elseありver
list_6= [i if i%2 == 0 else "奇数" for i in range(10)] list_6
if else orありver(世界のなべあつ風)
list_7 = ["サン" if i%3 ==0 or str(i)[-1] == '3' else i for i in range(1,101)] list_7