This makes b and a reference to the same list object. If you want b to reference to a new list object that is a copy of a, try:
b = a[:]
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more