官术网_书友最值得收藏!

Choosing Types

By now, you have learned about most of the common data structures in Python. One of the challenges you might face is knowing when to use the various data types.

When choosing a collection type, it is useful to understand the unique properties of that type. For example, a list is for you to store multiple objects and to retain a sequence, a dictionary is for us to store unique key-value pair mappings, tuples are immutable, and sets only store unique elements. Choosing the right type for a particular dataset could mean an increase in efficiency or security.

Choosing an incorrect type for your data will lead to data loss, in most cases it leads to low efficiency while running our code, and in the worst case, we might lose our data.

主站蜘蛛池模板: 怀仁县| 朝阳县| 东乡县| 贵阳市| 新郑市| 延川县| 望奎县| 尤溪县| 玉山县| 资兴市| 论坛| 绥宁县| 黄石市| 昆山市| 大洼县| 原阳县| 建水县| 鲁甸县| 阆中市| 天柱县| 石阡县| 石首市| 青田县| 当涂县| 晋江市| 剑阁县| 双流县| 深圳市| 巩留县| 临武县| 东乡| 靖边县| 玛纳斯县| 长白| 广元市| 运城市| 安西县| 温州市| 都兰县| 赣榆县| 南乐县|