I tried:
x = [1,2,3,4,5,6,7,100,-1]
y = [a for a in x.sort()[0:5]]
print(y)
y = y[0:4]
print(y)
but that won't work because sort() doesn't return the sorted list
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-21-d13e11c1e8ab> in <module>
1 x = [1,2,3,4,5,6,7,100,-1]
----> 2 y = [a for a in x.sort()[0:5]]
3 print(y)
4 y = y[0:4]
5 print(y)
TypeError: 'NoneType' object is not subscriptable