1 #List () converts an iterative object to a table2 #tuple () converts an iterative object into a tuple3STR1 ="I want to go fishing."4STR2 =list (str1)5 Print(STR1)6 Print(STR2)7STR3 =tuple (STR1)8 Print(STR3)9 Ten #max function and min function OneList1 = List ("ABCABC") A Print(List1) - Print(Max (List1))#find the maximum value in an element - Print(min (List1))#find the minimum value in an element the - #Sum function - Print(Sum ((1,), 2))#for list and value and - Print(Sum ((1,2,3,4,5,6)))#List of all elements and + -List2 = [2,6,9,6,5,2,8,2] + Print(Sorted (LIST2))#sort a list or a tuple A Print(List (Reversed (LIST2)))#reverses a list or tuple, returning an iterator at -List2 = [1,2,3,4,5,6] - Print(List (Enumerate (LIST2)))#converts a list or tuple into an enumeration sequence, and returns an iterator - -List1 = (1,2,3,4,5,6,7,8) -List2 = (2,3,4,5,6) in Print(List (Zip (list1,list2)))#Merge two lists or tuples, and leave out the extra elements
Python Learning Notes-basic use of sequences