To write a python program for getting the word count from a text.
PC Anaconda - Python 3.7
assign value for num_word
open the file in read mode
iterate using for loop
increment the word with length of the word
print the number of words in text
num_word=0
with open("My File.txt","r")as file1:
for i in file1:
word=i.split()
num_word+=len(word)
print("number of words {}".format(num_word))Thus the program is written to find the word count from a text.

