A recap of python basics

Data structures

list

list is the most useful collection type. e.g.

a=[1,2,3]

list is a mutable type, unlike a string.

indexing and slicing

a[-1]  #the last one

a[:]  #all the elements
a[1:] #from the index 1 to the end
a[1:3] # from index 1, to index 3-1
a[1:-1] # from index 1, to index -1-1

..................