I have a module designed to allow users to enter 10 words, then alphabetize them, and display them. Just using the sort functions puts capitalized words first, so i used sort(list, key=str.lower) but the output is still incorrect. Code, and error, below:
def words_function():
words = [input("Enter 10 words, one at a time: ") for i in range(10)]
sorted(words, key=str.lower)
print("Alphabetized, your words are: ", words)
userSearch = input("What word would you like to search for?")
if userSearch in words:
print("Found!")
else:
print("Not Found!")
words_function()
And it outputs this order: ['Aardvark', 'coke', 'Desk', 'Zippy', 'zappy', 'Television', 'brothel', 'book', 'Dad', 'dog']
Which, last time I took English, wasn't alphabetical =p. What else do I need to add to my sort, or change, to make it come out in proper alphabetical order, ignoring if the word is lower case or capital, and just sorting in based on alphabetization?
Aardvark, book, brothel, coke, Dad, Desk, dog, Television, zappy, Zippy