我正在 python 3.7 上嘗試一個小項目,但似乎無法讓它工作。我想找到存儲在包含許多列表的對象中的給定列表。我確定我的編碼很差,因為我在這方面幾乎是新手!my_choice = ["a", "b", "c"]reciepe1 = [["a", "b", "c"], "d", "e", "f"]reciepe2 = ["x", "y", "z"]menu = [reciepe1, reciepe2]for my_choice in menu: if my_choice in reciepe1: print(reciepe1) elif my_choice in reciepe2: print(reciepe2)
從列表的存儲/庫中查找給定的列表
慕的地8271018
2021-09-02 19:25:54