I need help with this program because I keep typing example.txt for the name file to upload
Fantastic news! We've Found the answer you've been seeking!
Question:
I need help with this program because I keep typing example.txt for the name file to upload these outputs for test 1. Also, it's programming output for test 2. How do I do this to type the correct modifying file when it asks for the file name? What do I change to correct this?
Transcribed Image Text:
nd Study Tools tions access Tips ccess Tips FOR YOU Hacks n Writing back CENGAGE| MINDTAP Programming Exercise 5.7 V E Tasks 8 Checks Custom Test Complete Delete file at start 4 out of 5 checks passed. Review the results below for more details. Custom Test Complete Create file for test 1 Test Case Incomplete Program output test 1 Custom Test Complete Delete file at end Code Pattern. Complete Output was not hard coded into the program 0.00 5.00 Program produces correct output for given input, test 2 Checks 3 out of 4 checks passed. Review the results below for more details. Custom Test Complete Delete file at start Custom Test Complete Create file for test 2 Test Case Incomplete Program output test 2 Custom Test Complete Delete file at end Run checks > > > > > > > > Submit 33% unique.py + 1 input File = input("Enter the input file name: ") 2 inFile = open(inputFile) 3 uniqueWords = [] 4 for line in inFile: 5 6 words = line.split() for current Word in words: currentWord = currentWord.strip(',.?!') if currentWordnot in uniqueWords: uniqueWords.append(currentWord) 9 10 inFile.close() 11 uniqueWords.sort() 12 print() 13 for currentWord in uniqueWords: 14 print(currentWord) 15 >_ Terminal + Q Search this course Enter the input file name: example.txt Traceback (most recent call last): File "/root/sandbox/unique.py", line 2, in inFile = open(inputFile) FileNotFoundError: [Errno 2] o such file or directory: 'example.txt' Microsoft OneDrive We'd love your feedback! We have just two questions for you. nd Study Tools tions access Tips ccess Tips FOR YOU Hacks n Writing back CENGAGE| MINDTAP Programming Exercise 5.7 V E Tasks 8 Checks Custom Test Complete Delete file at start 4 out of 5 checks passed. Review the results below for more details. Custom Test Complete Create file for test 1 Test Case Incomplete Program output test 1 Custom Test Complete Delete file at end Code Pattern. Complete Output was not hard coded into the program 0.00 5.00 Program produces correct output for given input, test 2 Checks 3 out of 4 checks passed. Review the results below for more details. Custom Test Complete Delete file at start Custom Test Complete Create file for test 2 Test Case Incomplete Program output test 2 Custom Test Complete Delete file at end Run checks > > > > > > > > Submit 33% unique.py + 1 input File = input("Enter the input file name: ") 2 inFile = open(inputFile) 3 uniqueWords = [] 4 for line in inFile: 5 6 words = line.split() for current Word in words: currentWord = currentWord.strip(',.?!') if currentWordnot in uniqueWords: uniqueWords.append(currentWord) 9 10 inFile.close() 11 uniqueWords.sort() 12 print() 13 for currentWord in uniqueWords: 14 print(currentWord) 15 >_ Terminal + Q Search this course Enter the input file name: example.txt Traceback (most recent call last): File "/root/sandbox/unique.py", line 2, in inFile = open(inputFile) FileNotFoundError: [Errno 2] o such file or directory: 'example.txt' Microsoft OneDrive We'd love your feedback! We have just two questions for you.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Suppose you want to buy a house that is sold by way of a first-price sealed bid auction. In contrast to the model in the lecture, there are more than 2 players. Players simultaneously and...
-
Suppose that cart 1 has a mass of 3.00 kg and an initial speed of 0.250 m/s. Cart 2 has a mass of 1.00 kg and is at rest initially. (a) What is the final speed of the carts? (b) How much kinetic...
-
Given that the data are matched and considering the units of the data, does it make sense to use the difference between each white blood cell count and the corresponding red blood cell count? Why or...
-
On a day without any wind, your car consumes \(x\) gallons of gasoline when you drive at a constant speed, \(U\), from point \(A\) to point \(B\) and back to point \(A\). Assume that you repeat the...
-
Beaty Company has the following internal control procedures over cash receipts. Identify the internal control principle that is applicable to each procedure. (a) All over-the-counter receipts are...
-
comments about these post? 1. The bullwhip effect is a word used to explain a situation in supply chain management where minor consumer demand changes can cause intense fluctuations in demand...
-
Capstone Case: Sunrise Bakery Expansion The Sunrise Bakery Corporation was originally founded in Houston, TX in 1991 by Griffin Harris, who currently serves as the company's Chief Executive Officer....
-
Should there be mandatory sentencing for major crimes? Give examples of crimes What are some alternative sentencing options you would employ if you were in the position to do so?
-
Assume that you are the Human Resource (HR) Director of an Australian company that has begun international assignments in the UAE. You are considering using an external consulting firm to provide...
-
Submission: 1. All submissions will be via Blackboard. Please see assignment in this module. 2. Your accepted sources for obtaining help: module resources, textbook, course instructor and GTA 3. The...
-
CJ Lance Co. is considering two Mutually Exclusive Projects Project Alpha-1 is expected to generate cash flows of $3,250 each year of its 5 year life. The project will cost $11,000. Project Beta-2 is...
-
Dealing with Fraud A manufacturing company has production facilities in Europe. While the company has been expanding rapidly over the last several years, the VP Production continues to have...
-
V. This problem provides a numerical example of part of the encryption that goes one with DES. (figures, tables,... for the DES encryption algorithm are provided below and in the slides). Show your...
-
David and Faisal are partners. they differ on everything from politics to sports. they do argue, but rationally and especially, civilly. they do so out of a firm belief in the idea of the social...
-
In muscle tissue, the ratio of phosphorylase a to phosphorylase b determines the rate of conversion of glycogen to glucose 1phosphate. Classify how each event affects the rate of glycogen breakdown...
-
Olive Corporation was formed and began operations on January 1, 2012. The corporation's income statement for the year and the balance sheet at year-end are presented below. The corporation made...
-
Sherry Hopson owns a retail family clothing store. Her store is located at 4321 Circle Drive, Houston, TX 77001. Her employer identification number is 95- 1234321 and her Social Security number is...
-
Frank Willingham has the following transactions during the year: Sale of office equipment on March 15 that cost $20,000 when purchased on July 1, 2010. Frank has claimed $5,000 in depreciation and...
-
(a) A car is speeding up in the negative \(x\) direction. In what direction do \(\vec{a}\) and \(\vec{v}\) point? (b) To which of the four graphs in Figures 3 . 2 and 3 . 3 does the situation...
-
The \(x\) component of the velocity of a car changes from \(-10 \mathrm{~m} / \mathrm{s}\) to \(-2.0 \mathrm{~m} / \mathrm{s}\) in \(10 \mathrm{~s}\). (a) Is the car traveling in the positive or...
-
A classmate leaves a message on your voice mail betting that you cannot throw a stone high enough so it lands on the roof of a 20 -m-high building. As you stare out of your window pondering whether...
Study smarter with the SolutionInn App