Built-in Data Structures: Lists
Operators
Concatenation +
[1, 2] + [3, 4] + [5]
Repetition *
foo = [1, 2] * 5
Positional operators
Index list[i]
Slice list[i:j]
bar= foo[2:5]
print bar
[ 2, 1, 2, 1, 1 ]
Length len(list)
Generation
Ranges range(start,end,step)
Previous slide
Next slide
Back to first slide
View graphic version