#Encoding=utf-8#tuples, like lists, are also a sequencePrint(A)PrintThePrint(1,)Print1, a=1Print(Type (a)) a=1,2,3Print(Type (a))#The tuple function (tuple) takes a sequence as an argument and turns it into a tuple, and returns if it is a tuplea=[1,2,3,4,4]b=tuple (a)Print(a)Print(Type (a))Print(b)Print(type (b)) C=tuple ('ABC')#converting a list to a tuplePrint(c)#(' A ', ' B ' ' C ')#tuples are not really complicated-there are not too many other operations in addition to creating tuples and accessing tuples, you can refer to other types#sequence to implement thea=1,2,3Print(A[1])#2Print(A[1:2])#(2,)Print(a[:])#(a)Print(A[::2])#(1,3)Print(1inchA#Truereversed (a)Print(a)#reversed is not valid for tuples#Chapter II Summary of new functionsCMP (x, y)#compares two values, returns the X-y value DifferenceLen (Sequence)#the length of a sequenceList (iterator)#convert a sequence into a listMax (arguments)#the maximum value of a parameterMin (arguments)#y The minimum value of a parameterReversed (Sequence)#Reverse iterate a tuple
02-Tuple of basic python learning