Open angel54771 opened 3 years ago
寫了一個刪掉山的副程式可以用
mountain_lst=["大武山","波路山"] def delete__by_values(lst, values): values_as_set = set(values) return [ x for x in lst if x not in values_as_set ]
mountain_lst = delete__by_values( mountain_lst, ["波路山","良羽鳥山","馬望曾呂山","佳仁山","老松山","班山","能甲山","牧山","馬望來山","劍山","金面山"] ) print(mountain_lst)