-
List for storing digital collection.
-
List comprehension. squares = [value ** 2 for value in range (1,11)]
expressed as value ** 2, for providing values to the expression for the loop. -
Replication list, create a list that contains the entire slice is while omitting starting index and ending index ([:]).
. = EG friends_foods my_foods [:] -
friends_foods = my_foods, this syntax is actually allow python to associate friends_foods new variable to the list contained in my_foods in, so these two variables point to the same list.
-
Ganso looks like a list, but the use of parentheses instead of square brackets, its elements can not be modified unless redefine Ganso.
"Python programming from entry to practice" (Chapter IV. Operation List) notes
Guess you like
Origin blog.csdn.net/qq_38122800/article/details/104104421
Ranking