Set, Sequence, Dictionary << Container << Iterable
General Operation for Container, Iterable and Sequence
The built-in len function takes any container as an argument and returns the number of items in the container.
The built-in min and max functions take one argument, a nonempty iterable whose items are comparable, and return the smallest and largest items, respectively.
The built-in sum function takes one argument, an iterable whose items are numbers, and returns the sum of the numbers
You can concatenate sequences of the same type with the + operator.
ou can multiply a sequence S by an integer n with the * operator. S*n or n*S is the concatenation of n copies of S.
The x in S operator tests to check whether object x equals any item in the iterable S.
The x not in S operator is just like not (x in S).
In the specific case of strings, though, x in S is more widely applicable; in this case, the operator tests whether x equals any substring of string S, not just any single character.
Special Operation for List
L.count(x)
L.index(x)
L.append(x)
L.extend(s)
L.insert(i, x)
L.remove(x)
L.pop([i])
L.reverse( )
L.sort(cmp=cmp, key=None, reverse=False)
Special Operation for Set
S.copy( )
S.difference(S1)
S.intersection(S1)
S.issubset(S1)
S.issuperset(S1)
S.symmetric_difference(S1)
S.union(S1)
S.add(x)
S.clear( )
S.discard(x)
S.pop( )
S.remove(x)
S-S1 = difference
S&S1 = and
S^S1 = NOR
S|S1 = or
Special Operation for Dictionary
D.copy( )
D.has_key(k)
D.items( )
D.keys( )
D.values( )
D.iteritems( )
D.iterkeys( )
D.itervalues( )
D.get(k[, x])
D.clear( )
D.update(D1)
D.setdefault(k[, x])
D.pop(k[, x])
D.popitem( )