2つのイテラブルを比較し、両方のイテラブルに表示されるアイテムを印刷したいと思います。
>>> a = ('q', 'r')
>>> b = ('q')
# Iterate over a. If y not in b, print y.
# I want to see ['r'] printed.
>>> print([ y if y not in b for y in a])
^
しかし、が配置されている場所では無効な構文エラーが発生します^
。このランバ関数の何が問題になっていますか?