Tag Archives: Count Words in Text File Python Program

Python Count Words in Text File

Topic: Count Words in Text File Python Program # Python program to count # number of words in a text file # Input filename, open it in # read mode. display its cntents # count and display number of words # www.EasyCodeBook.com file_name = input(“Enter file name:”) file1 = open(file_name, “r”) word_count = 0 print(“Contents… Read More »

 705 total views