Basic Python and python tutorials
Liao Xuefeng's blog
1. variable parameters (for example, * nums) Allow the input of a list or tuple, but keyword parameters (for example, ** kv) Allow the input of a dict. For details, refer to this page;
2. set is similar to dict, but it is only a set of keys and does not store value;
3. the Python slice operation uses [start Index: end index: step], meaning to start from start index (from zero) and end index, and does not contain end index, take one element for each step. If step is-1, data is flipped sequentially. If you want to start from the last element, start index starts from-1;
L = ['A', 'B', 'C', 'D', 'E']> L [0: 2] ['A ', 'C', 'E'] >>> L [:-1] ['E', 'D', 'C', 'B ', 'A'] >>> L [-1:-3:-1] ['E', 'D'] >>> L [-2:] ['D', 'E']
4. All objects that can act on the for loop are of the Iterable type, such as list, tuple, dict, set, str, and generator;
All objects that can act on the next () function are of the Iterator type. They represent a sequence of inert computing;
5.