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

Strings and Collections

Python includes a rich selection of built-in collection types which are often completely sufficient for even quite intricate programs without resorting to defining our own data structures. We'll give an overview of some of these fundamental collection types now – enough to allow us to write some interesting code – although we'll be revisiting each of these collection types, together with a few additional ones, in later chapters.

Let's start with these types:

  • str – immutable strings of Unicode code points
  • bytes – immutable strings of bytes
  • list – mutable sequences of objects
  • dict – mutable mappings from keys to values

Along the way, we'll also cover Python's for-loops.

主站蜘蛛池模板: 南汇区| 太保市| 吉首市| 东辽县| 益阳市| 广丰县| 喀什市| 安岳县| 五河县| 胶南市| 青河县| 炉霍县| 郓城县| 龙门县| 攀枝花市| 三亚市| 泸州市| 南岸区| 静海县| 乐昌市| 古蔺县| 涟水县| 修武县| 五常市| 宁强县| 岐山县| 英超| 金寨县| 天峨县| 林西县| 信阳市| 怀柔区| 芮城县| 永康市| 康保县| 吉林省| 苏尼特左旗| 聂荣县| 关岭| 巧家县| 潞西市|