In Python, I'm getting a list with emptiness ( i.e. [ ] ) in it and testing mechanics indicate that its not sorting the content properly. It fails to pass the sorting of items contained in a file.
Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order.
textFile = input("Input a file name: ")
with open(textFile) as objects:
textReader = objects.readlines()
textReader.sort()
print(textReader)
Output: [ ]