What does this notation do for lists in Python: “someList[:]”?
[:] creates a slice, usually used to get just a part of a list. Without any minimum/maximum index given, it creates a copy of the entire list. Here’s a Python session demonstrating it: >>> a = [1,2,3] >>> b1 = a >>> b2 = a[:] >>> b1.append(50) >>> b2.append(51) >>> a [1, 2, 3, 50] … Read more