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

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.

主站蜘蛛池模板: 深水埗区| 临沂市| 丰台区| 孝义市| 寿宁县| 勃利县| 保定市| 阿拉善右旗| 峡江县| 四子王旗| 永定县| 亳州市| 苗栗市| 武隆县| 靖安县| 彭阳县| 会泽县| 澄迈县| 咸丰县| 阿城市| 皋兰县| 太康县| 和田县| 建平县| 奉贤区| 兰坪| 丹巴县| 乐都县| 德化县| 启东市| 横山县| 临江市| 博罗县| 千阳县| 太原市| 舒城县| 获嘉县| 石河子市| 黔东| 江陵县| 长沙县|