- Learn Programming in Python with Cody Jackson
- Cody Jackson
- 145字
- 2021-06-10 19:06:11
Dictionary details
There are a few key points about dictionaries that you should be aware of:
- Sequence operations don't work. As previously stated, dictionaries are mappings, not sequences. Because there's no order to dictionary items, functions such as concatenation and slicing don't work.
- Assigning new indexes adds entries. Keys can be created when making a dictionary (that is, when you initially create the dictionary) or by adding new values to an existing dictionary. The process is similar and the end result is the same.
- Keys can be anything immutable. The previous examples showed keys as string objects, but any non-mutable object (such as numbers) can be used for a key. Numbers can be used to create a list-like object but without the ordering. Tuples are sometimes used to make compound keys; class instances that are designed not to change can also be used if needed.
推薦閱讀
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- x86匯編語言:從實模式到保護模式(第2版)
- Oracle Exadata專家手冊
- Learning FuelPHP for Effective PHP Development
- 單片機C語言程序設計實訓100例
- Clojure for Machine Learning
- C語言程序設計簡明教程:Qt實戰
- MySQL程序員面試筆試寶典
- App Inventor 2 Essentials
- 愛上C語言:C KISS
- INSTANT Apache ServiceMix How-to
- 多媒體技術及應用
- Clojure High Performance Programming(Second Edition)
- 數據結構:Python語言描述
- Instant GLEW