Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Python でラムダをいじってみると、次のコードが Python 2.7.3 で有効であり、ラムダを返すことがわかりました。
x = lambda: 1 if x else 2
このように使用すると、ラムダが x を定義するのはなぜですか?
編集: Python 構文はどうやら私には難しすぎるようです。受け入れられた回答を参照してください…</p>