Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python code...please help! My ReadLines() function is working fine, but my Write

ID: 3724939 • Letter: P

Question

Python code...please help! My ReadLines() function is working fine, but my WriteFile(allLines) is not. Thanks for the help!
AttributeError: ‘str’ object has no attribute ‘readlines’
(The error message I’m getting is for line 20 and line 13, both of which are in WriteFile(allLines) function)
def ReadLines: fobj = open(inputt, 'r') count = 1en(open(inputt).readlines()) count += 1 return count a1 1 Lines = inputt tdef WriteFile(allLines): file = open(inputt,'w') allLines.readlinesC) for line in allLines: line[3] if 'I': != file.writeCline) rev print('inputt written") ReadLineso WriteFile(allLines)

Explanation / Answer

Modified Code :