Question: In python... I think there might be an issue with my code as I keep getting errors. The writefile() function should use the same lines
def ReadFileO: file = input("Enter filename : ") num lines 0 with open(file, 'r') as f: for line in f: 1 lines num-lines += print("There are %d in the file %s" %(num-lines , file)) if "_namemain ReadFileO def WriteFile(linesRead): with open('myout.txt', 'w) as f: for line in linesRead: if not line.startswithC'I): f.write(line) print("myout. txt written # solution must be above this comment # do not change any part of the code below def mainO: linesRead = ReadFile() WriteFile(linesRead) if namemain": main)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
