Doubt regarding list methods

a = [1,2,3,4,1,1,2,3]
b = a.reverse()
output : none

Doubt: Why the a.reverse() is not directly assigned to b ? It shows none output.
But when we using another method like count()

a = [1,2,3,4,1,1,2,3]
b = a.count(1)
output: 3
it is also a method but it directly assigning a.count(1) to b… it is not showing none as a result. Why??

a.reverse() is updating the existing list a .

The key point here is that it is updating without returning any value.

And the update is happening in the list where you are performing this action i.e, the value of a is now updated with its reverse value. And since it’s not returning any value , so it’s assigning NONE to variable b.

This is .reverse() property. in case of count() it returns the value of counts of the list elements, hence the value gets assigned to variable b.

Ohk… Got it… Sir