Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python help....would like to leave code the same but unsure of how to solve these errors! Thank you :) def ReadFileO: file = input(Enter filename:

Python help....would like to leave code the same but unsure of how to solve these errors! Thank you :) image text in transcribed
image text in transcribed
def ReadFileO: file = input("Enter filename: ") num-lines = 0 str= '' with open(file, "') as f for line in f: str = str + line num-lines = num-lines + 1 print("There are %d lines in the file %s" %(num-lines,file)) return str def WriteFile(linesRead): file = open("myout . txt', 'w') for line in linesRead. splitlinesO: if not line.startswith'I' file.writeCline+n) print('myout.txt written) linesRead-ReadFileO WriteFileClinesRead)

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Identify conflict triggers in yourself and others

Answered: 1 week ago