Tuple
nature : an ordered set of
features :
(1) a list is very similar to
(2) can not be modified once the initialization
(3) with parentheses
create 1. tuple
format : name = tuple (a tuple element , tuple element 2, ..., tuple element n-)
(. 1) create an empty tuple
(2) create a tuple, the tuple of elements with different types of elements may be
element (3) is only a defined element group
2 elements accessed tuple
format: tuples name [index], index starting from 0
3 modified tuple
4. remove tuple
5. operation tuple
(1) adding the tuple
(2) element group repetition
(3) determining whether the element in the tuple
taken (4) tuple
format: tuple name [beginning index, ending index]
from the beginning of the next subscript start capturing, taken prior to the end marker
(5) two dimensional groups: a one-dimensional element is a tuple of the tuple
6. tuple
(1) len () returns the number of elements in the tuple
returns the maximum value tuples of elements (2) max ()
(. 3) min () returns the minimum value tuple element
(4) will be transformed into a list of tuples tuple (list name)
(5) traversing the tuple
python study notes eleven (tuple)
Guess you like
Origin blog.csdn.net/weixin_38324954/article/details/94563748
Recommended
Ranking