I am perplexed at the behavior of python code below. I want to sort last 3 numbers in a list. But when I chain the operations, it doesn't work. What am I missing?
Behavior 1:
>>> a = [10,4,2,3]
>>> b = a[1:].sort() # I want to sort last 3 numbers. But when I chain the
# operations, it doesn't work. Why?
>>> b
<empty value>
====
Behavior 2:
>>> a = [10,4,2,3]
>>> b = a[1:]
>>> b.sort()
>>> b
[2, 3, 4]