Year 11
Lesson details
Key learning points
- In this lesson, we will be introduced to text files. The focus will be on reading text files, and how the data from a text file can be used within a program. We will be stepped through the key methods that are used for reading text files in Python, before we complete two text file challenges.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
3 Questions
Q1.
A coded message has been created. Solve the message below: +3 FLSKHU
CODED
CRYPTIC
IOVNKX
Q2.
A coded message has been created. Solve the message below: +2 LWNKWU
GENIUS
JULIAN
NYPMYW
Q3.
A coded message has been created. Solve the message below: +4 TCXLUR
CIPHER
SCRIPT
XGBPYV
4 Questions
Q1.
If you want to open a text file in write format, what would you put in the highlighted space in this code?
a
r
r+
Q2.
If you want to open a text file and add to that file, what would you put in the highlighted space in this code?
r
r+
w
Q3.
If you want to open a text file and read that file, what would you put in the highlighted space in this code?
a
r+
w
Q4.
True or False: The readline() method always returns and additional line space at the end of it.
False