- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 122字
- 2021-07-02 21:09:32
Set
The final data structure we'll look at is the set. A set is a collection of data values without keys; like a list, but in no particular order, like a dictionary. We can create a set using a set expression, which is a pair of curly brackets around comma-separated values, as shown in the following code example:

Locating a specific value in a set is fast, as is adding or removing a value, as shown in the following example:

Each value can only be in the set once. Sets support a bunch of mathematical operations, such as union and intersection, and are generally more useful than might be obvious at first, though we can't really prove that here in this section.
推薦閱讀
- 信息可視化的藝術:信息可視化在英國
- Architecting the Industrial Internet
- 假如C語言是我發明的:講給孩子聽的大師編程課
- iOS開發實戰:從入門到上架App Store(第2版) (移動開發叢書)
- Mastering Adobe Captivate 7
- 監控的藝術:云原生時代的監控框架
- Java高手是怎樣煉成的:原理、方法與實踐
- 3D Printing Designs:The Sun Puzzle
- Computer Vision with Python 3
- Testing Practitioner Handbook
- Learning Java by Building Android Games
- WCF 4.5 Multi-Layer Services Development with Entity Framework(Third Edition)
- Python Data Visualization Cookbook(Second Edition)
- UG 12.0數控編程實例教程
- Android移動應用設計與開發(第2版):基于Android Studio開發環境