def formatWords(words):
result = "Word List:\tWord Count:\n"
for i in words:
result += i + ":\t" + str(words.count(i)) + "\n"
return result
words is just an array of strings.
I am supposed to get an output of
I get the output of
How do I format the string to look like the first picture?