そんな場面を考えてみましょう。 まず普通に書くと、次のようになります👇 result = {} for u in users: result[u["id"]] = u["name"] 昨日の「リスト内包表記」に続いて、 "辞書を作るときはどう書けるの?"というのが、今日のテーマです。 同じ処理が、次のように1行で ...
This lab allows you to practice and apply the concepts and techniques taught in class. Upon completion of this exercise, you will be able to: Write concise and efficient code using list comprehension.
This lab allows you to practice and apply the concepts and techniques taught in class. Upon completion of this exercise, you will be able to: Write concise and efficient code using list comprehension.
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する