Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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? imageimage


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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

2. Remind students of upcoming assignments.

Answered: 1 week ago

Question

Pick one judgmental method and describe it.

Answered: 1 week ago