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
Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.
Khoa Nguyen -
SOVANNARO -
SOVANNARO -
Alessio Michelini -
Top comments (1)
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.