Pythonを学び始めると、避けては通れない非常に重要なデータ形式があります。それが「辞書(dictionary、通称dict)」です。辞書は、大量のデータを効率よく管理し、必要な情報を一瞬で取り出すことができる非常に強力なツールです。 本記事では ...
Day32では、in と計算量の感覚を通して、 list・set・dict の使い分けを学びました。 今回はその次のステップとして、 「コレクションを for 文でどう扱うか」 を整理します。 Pythonを書いていると、かなりの頻度でこういう処理が出てきます。 listの中身を1件 ...
Python 3.15 introduces an immutable or ‘frozen’ dictionary that is useful in places ordinary dicts can’t be used. Only very rarely does Python add a new standard data type. Python 3.15, when it’s ...