programming

我的想法


In python, a list is a sequence of values separated by commas and enclosed in square brackets.

nums = [1,2,3,4,5]

Lists may contain items of different types, but in practice they are often used to store items of the same type

Similar to Array in C and Tuple in Python itself, all elements start at location 0.

And what is more similar to Array is it is mutable!

For example,

nums = [1,2,3,4,5]
nums[0] = 3

Then the element will change to

nums
[3,2,3,4,5]

Reference