I am trying to do a simple word count of a text file and output it to a text file.
For eg my array looks like this:
word_freq = [('test', 1), ('of', 1), ('function', 1), ('first', 1), ('the', 2)]
I was able to output to a text file in the following manner
[('word1', 3), ('word2', 2), ('word3', 1), ('word4', 1), ('word5', 2)]
How do I export to text file to look this:
Thanks for your help.