I come from a Javascript background (where properties can be accessed through both . and [] notation), so please forgive me, but what, exactly, is
.
[]
[] is the index to a container, such as a list or dictionary.
. is the member of an object and modules. It can be a method, member data, or attribute.
>>> xs = [1, 7, 3, 4, 5, 4, 3, 4, 1] >>> xs.count(4) 3 >>> xs[1] 7