I tried to understand [:]
in the beginning, but I can't find any document mention it. Where is the best place to learn advanced grammar for Python? Google search won't find [:]
. But I figured it out at the end. I just wonder where is best place to learn Python 'tricks'.
For example:
def test(x, y):
x[:] = y
#x = y
>>> a = [0.5,0.6]
>>> b = [0.3]
>>> test(a, b)
>>>
>>> print a
[0.3] # [0.5,0.6]