+ 2
python : single liner
'''why this code returns none''' list = input().split(',').sort() '''but this not give None''' list = input().split(",") list.sort()
5 odpowiedzi
+ 2
The `None` came from (returmed by) sort(), as it sorts the `list` in place instead of returning a sorted copy of the `list` like the sorted() function.
+ 2
Sunil Shrestha use sorted() as suggested by Ipang
list = sorted(input().split(','))
+ 1
doesnt split function return any value?
+ 1
means sort doesnt return value
0
Yes that's right