Why None?
Arun

Arun @arun04hack

About: Enthusiastic person in python programming and a beginner in machine learning

Joined:
Mar 15, 2025

Why None?

Publish Date: Mar 15
0 2

names = ["Eren", "luffy", "goku"]
print(names.sort())
Output: None
Why the sort method can't sort the list?

Comments 2 total

  • arccoder
    arccoderMar 15, 2025

    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.

Add comment