
Year 10 Text Files
Presentation
•
Computers
•
10th Grade
•
Medium
Roy Duguid
Used 13+ times
FREE Resource
15 Slides • 6 Questions
1
Paper 1 - programming > Reading and Writing to files > Do Now
2
Lesson Objectives:
Understand the structure and purpose of text files. Learn how to read data from a text file using Python.
Gain proficiency in writing data to a text file using Python.
Develop error handling skills when working with text files.
Apply file handling techniques to solve practical problems.
Key words:
Text files, Read, Write, File handling, Open() Modes (read, write, append), Error handling, Data manipulation
3
4
5
6
7
8
9
10
11
14
15
Multiple Choice
This command will open file = open("mytext.txt", "r")
To read the file
To append to the file
To write to the file
16
Multiple Choice
This command will open file = open("mytext.txt", "w")
To read the file
To append to the file
To write to the file
17
Multiple Choice
If I want to add to the end of a text file, I should:
file = open("file.txt", "w")
file = open("file.txt", "a")
file = open("file.txt", "w+")
file = open("file.txt", "s")
18
Multiple Select
Which of these will generate an error?
file.write("writing")
file..write(writing)
file.write("writing",writing)
file.writetofile()
19
Multiple Select
How do you close the file?
file = close
file.close
close = file()
20
Multiple Select
Why do we close txt files after we are done with them?
This frees up any memory used by having it open
It makes no difference if its closed or not
Once closed, the file cannot be read from or written to without opening it again
It's easier to write to once it's closed
21
Complete challenges
Paper 1 - programming > Reading and Writing to files > Do Now
Show answer
Auto Play
Slide 1 / 21
SLIDE
Similar Resources on Wayground
16 questions
pronoun
Presentation
•
10th Grade
15 questions
Sentence Diagnostic
Presentation
•
10th Grade
15 questions
Mole & Molar Mass Conversions
Presentation
•
10th Grade
15 questions
PROBABILITY
Presentation
•
10th Grade
15 questions
WWI Military Technology
Presentation
•
10th Grade
16 questions
Hardware and software
Presentation
•
10th Grade
18 questions
Mole to Mole Ratio
Presentation
•
10th Grade
18 questions
Discovery of the cell and the Cell Theory
Presentation
•
10th Grade
Popular Resources on Wayground
10 questions
How much do you know about our Portrait of an Eagle?
Quiz
•
10th Grade
10 questions
Fast Food Slogans
Quiz
•
6th - 8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
[AP CSP] Python Coding: Functions, Parameters, Return
Presentation
•
9th - 12th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade
20 questions
APCS Unit 1A
Quiz
•
9th - 12th Grade
24 questions
Binary
Quiz
•
9th - 12th Grade