Question: Using Python What am I doing wrong? This is what I'm supposed to do This what I did, and it's not working. The text file

Using Python

What am I doing wrong?

This is what I'm supposed to do

Using Python What am I doing wrong? This is what I'm supposed

This what I did, and it's not working. The text file is save in the same place and everything.

to do This what I did, and it's not working. The text

Processing the File Create a markdown cell with a level 2 header that reads "Processing the File". Add unformatted text explaining that you will now use the process_file() function to read and process the contents of the file tale_of_two_cities.txt. Use the process_file() function to read in the file tale_of_two_cities.txt, storing the returned list into a variable named words. Then print the message shown below with the xxxx characters replaced with the number of elements in the list words. Make sure that the output message is formatted correctly. There should be exactly one space between any two consecutive words or numbers in the sentence. There are xxxx words contained in the file. We will now print the first few words contained in the novel. stelt in the code cell to print the first 20 words of the list words. Use list slicing to select the first 20 words. Do not use Processing the File Will be using the process_file() function to read and process the contents of the file tale_of_two_cities.txt. In [7]: words = (process_file(tale_of_two_cities.txt)) NameError Traceback (most recent call las t) - /Desktop/Cosc 130/Projects/project 2/word_count.py in ----> 1 words - (process_file(tale_of_two_cities.txt)) NameError: name 'tale_of_two_cities' is not defined

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!