
file_handling_BN23
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Brian New
Used 2+ times
FREE Resource
10 Slides • 10 Questions
1
File Handling
CS
2
goals
O I can accurately describe how to handle a file
O I can write python code to read and write data to a file
3
Open Ended
When file handling, an endOfFile() command is very important.
Describe what this is as best you can.
4
endOfFile()
The endOfFile() command simply returns True or False as to whether we have reached the last line (or end) of a file. It allows code to detect when to stop reading from a file -- there is no more data to read.
5
Multiple Choice
endOfFile() returns what?
a string
an integer
a boolean
the last line
6
Multiple Choice
endOfFile(), if returning True, means that we can keep reading data from a file...
No, because we have now arrived at the end of the file.
Yes, because there will be room at the end of the file to read more.
7
Multiple Choice
Why would we need to use endOfFile() in code?
To prepare a file for new data.
To stamp the end of data with an 'end point'.
To close a file for safety.
To detect when a loop needs to stop reading from a file.
8
goals
O I can accurately describe how to handle a file
O I can write python code to read and write data to a file
9
Open Ended
Now briefly describe everything you know about what the endOfFile() command is and what it is used for.
Bonus points for making your answer sound like it was written by a very angry wizard.
10
follow the link
add a new text file and write your own conversation
11
Why don't we need to use the endOfFile() command in this code?
12
Open Ended
# Write 4 brief, one-line comments that would help someone undertand the file handling parts of this code.
# At the start of each comment, specify which line the comment is about.
E.g. # (3) This imports the time module so that we can use the sleep() procedure.
13
goals
O I can accurately describe how to handle a file
O I can write python code to read and write data to a file
14
Fill in the Blanks
15
Fill in the Blanks
16
Fill in the Blanks
17
Draw
Draw an image to express why a file should be 'closed' after we have used it.
18
copy this code into a new project
can you work out how to format the 'characters' text file? Create a new text file that would work with this program.
19
20
goals
O I can accurately describe how to handle a file
O I can write python code to read and write data to a file
File Handling
CS
Show answer
Auto Play
Slide 1 / 20
SLIDE
Similar Resources on Wayground
14 questions
Infection Control: Hand Washing
Presentation
•
9th - 12th Grade
14 questions
Artigos definidos e Indefinidos - Inglês
Presentation
•
9th - 12th Grade
15 questions
Python
Presentation
•
10th - 12th Grade
17 questions
Formulas and Functions
Presentation
•
9th - 12th Grade
15 questions
Respiratory System
Presentation
•
9th - 12th Grade
15 questions
Solving Systems of Equations Review
Presentation
•
9th - 12th Grade
16 questions
Comma Rules
Presentation
•
9th - 12th Grade
16 questions
Asymptote Review
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade