diff --git a/Frequency.py b/Frequency.py new file mode 100644 index 0000000..14ae9c8 --- /dev/null +++ b/Frequency.py @@ -0,0 +1,6 @@ +from collections import Counter +def word_count(fname): + with open(fname) as f: + return Counter(f.read().split()) + +print("Number of words in the file :",word_count("Try.txt"))