I am writing a program to take a list of words from the user, remove the repeated words and then print the output after sorting the words. However, I ran into this issue while sorting:
a = set(input('Words: ').split(' '))
b = list(a).sort()
print(b)
The terminal prints 'None' as the result of the code, but in this case:
a = set(input('Words: ').split(' '))
b = list(a)
b.sort()
print(b)
It gives the right output. Why is this so?