ステートメント
not
で aを使用できないのはなぜですか? と の両方が反復可能であるとfor
仮定しますobject
list
それができない場合、別の方法はありますか?
以下に例を示しますが、「明らかに」構文エラーです。
tree = ["Wood", "Plank", "Apples", "Monkey"]
plant = ["Flower", "Plank", "Rose"]
for plant not in tree:
# Do something
pass
else:
# Do other stuff
pass