names = ["Eren", "luffy", "goku"]
print(names.sort())
Output: None
Why the sort method can't sort the list?
For further actions, you may consider blocking this person and/or reporting abuse
names = ["Eren", "luffy", "goku"]
print(names.sort())
Output: None
Why the sort method can't sort the list?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
It's sorting the list however not returning anything, that's why
None
.If you want the sorted list to be returned, use
sorted()
method.Ok