Introduction

1 Page
149 Views

Department
Computer Science
Course Code
CSCA08H3
Professor
Kathy Fellowes

This preview shows half of the first page. Sign up to view the full page of the document.
Description
CSCA08Introduction to ProgrammingFile Practice in PythonLast class Finished while loops with strings and began files reading and writingToday Finish filesOpen a file specified by the user of text for reading and determine the following from the text1Assume the title is the first line of the file2Assume the next line contains the author and the third line is blank3The story text will begin on the fourth line4Count the number of and but because and sos to determine the number of compound sentences in the text5Also keep a count of the number of words in the text6Write to another file the following1Title of the text on the first line2Number of compound sentences in the text on the second line3Total number of words in the text on the third line7What name to give the file we are writing toThe title in lowercase with no spaces1If the name already exists then open it for reading and compare it with the values you have just calculated2If the values are the same print a message that states you are all done3If the file already exists but the values are different print some warning messages and write the new values erasing
More Less
Unlock Document

Only half of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit