I am totally confused on the below code execution,
a= [10,30,4]
a = a.sort()
r = len(a) - 1
print (r)
When the above code is executed I get
r = len(a) - 1
TypeError: object of type 'NoneType' has no len()
However the code runs fine if I find the length without sorting or when sorting the array after find the length. Is there any reason to this?