Question: Write a program to read a text stored in the text file input.txt then create a list words of all words in the text file.
Write a program to read a text stored in the text file input.txt then create a list words of all words in the text file. The text file contains the text: Geometry enlightens the intellect and sets one's mind right - Ibn Khaldun To answer the question, drag and drop the statements (below) to their correct position in the code (above). infile = open("input.txt", 'r') print(words) line = line.rsplit() words +=line infile: words=0 for line
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
