Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please fix this error in Python. Here was the assignment. from sys import argv def longest_ word(fn_input): file_inputopen (mary.txt, r) maxLength0 maxWord = for
Please fix this error in Python. Here was the assignment.
from sys import argv def longest_ word(fn_input): file_inputopen (mary.txt, "r") maxLength0 maxWord = "" for line in file_input: for word in line.split(" "): if maxlength len (word): maxLengthlen (word) maxWord -word return maxword if _name_ "main__"; fn-in-argv [1]1 print(longest_word(fn_in)) In [17]: runfile ("/Users/Jay/Desktop/LAB/ untitled1.py', wdir- /Users/Jay/Desktop/ LAB') Traceback (most recent call last): File "Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started