Getting the basics of Python 3 --------

1. collection --------- set       characteristics: ① collection type is set, not by way of access to the collection element group; ②: there is no repetition characteristics set

2. The basic operation of a set of several

①: the length of seeking support collections

②: Check whether an element in the collection inside

③: two sets of operation: Set differencing

④: the intersection of two sets of ------------- &

⑤: find the union of two sets: --------- |

⑥: how to define an empty set: ---------- the SET ()

 

3. Dictionary ------ dict type: a number of key and value, the type of collection (set), the sequence

4. dictionary related operations:

①: key visit by value, can not be accessed by way of a sequence of elements

②: If there are two identical can right-what will happen? Note: dictionary not have the same key, even if there will automatically delete one

③: value may be str int float set list dict ---------------- key but must be immutable type (int str)

 Note: tuples can be a key but not when key list

④: empty dictionary, said:

to sum up:

Python basic data types:

A: Digital Number: int (integer) float (floating point) boolean (Boolean) complex (complex)

II: Group:

       ①: Sequence: string (str) list (list) tuple (tuple) ---------- subscript for the index to access, may slice a [1: 2]

       ②: collection: set   disorder, there is no index, not sliced

       ③: Dictionary: dict key and value requirements

 

 

发布了98 篇原创文章 · 获赞 34 · 访问量 3万+

Guess you like

Origin blog.csdn.net/weixin_42133768/article/details/86970402