Search Header Logo
Reading Files

Reading Files

Assessment

Presentation

Computers

9th - 10th Grade

Practice Problem

Medium

Created by

Calum Gordon

Used 1+ times

FREE Resource

16 Slides • 27 Questions

1

Reading Files

Reading in data from a text file

media

2

media

3

media

4

Multiple Select

Question image

In this lesson I am going to learn to ... ?

1

Open a file for reading

2

Read lines from a file

3

Close a file

4

Write data to a file

5

media

6

Multiple Choice

Question image

What does 'hard coding' data in a program file refer to?

1

The data values are the same every time the program is run

2

The data values are different every time the program is run

3

The program only works with one set of data

4

The programs works with different sets of data

7

Multiple Choice

In that case, what does 'soft coding' data in a program refer to?

1

The program will run with different data sets every time

2

The program always runs with the same data set

3

The program data is 'buit-in' to the program

8

media

9

Fill in the Blanks

media image

Type answer...

10

media

11

Fill in the Blanks

Type answer...

12

media

13

Multiple Choice

Question image

What file format can be used to store database records persistently?

1

.csv

2

.txt

3

.pdf

4

.doc

14

Fill in the Blanks

Type answer...

15

Fill in the Blanks

media image

Type answer...

16

Fill in the Blanks

media image

Type answer...

17

Multiple Choice

Question image

What symbol is used to delimit the data in the file?

1

,

2

.

3

:

18

Fill in the Blanks

media image

Type answer...

19

Multiple Select

Question image

Select the fields that contains integer data ...

1

ID

2

Username

3

MonthJoined

4

BirthMonth

20

media

21

Multiple Choice

Question image

What Python data structure will you be using to store the structured data?

1

List

2

String

3

Tuple

4

Array

22

media

23

Fill in the Blanks

media image

Type answer...

24

Fill in the Blanks

media image

Type answer...

25

Fill in the Blanks

media image

Type answer...

26

Fill in the Blanks

media image

Type answer...

27

media

28

Multiple Choice

Question image

Which file access method will read in all the lines of data from the file into a list?

1

theFile.readlines()

2

theFile.readline()

4

file.readlines()

29

Multiple Choice

Question image

Which file access method will read in all the lines of data from the file into a string?

1

theFile.readlines()

2

theFile.readline()

30

Multiple Choice

Question image

Which file access method will read in one line of data from the file into a string?

1

theFile.readlines()

2

theFile.readline()

31

media

32

media

33

media

34

Multiple Choice

What will be the data type of any data that is read in from a text file?

1

String

2

Float

3

List

4

Tuple

35

Multiple Choice

What symbol is added to the end of each line of data after being read using the .readlines() method?

1

'\n'

2

'\t'

3

'\r'

4

'\'

36

media

37

Multiple Choice

CR and LF are examples of non-printable characters. What are the decimal ASCII values of these characters?

1

0-31

2

32-63

3

64-93

4

94-127

38

media

39

Multiple Choice

Question image

What string manipulation method could be used to remove the '\n' character from the end of the read line?

1

.strip()

2

.split('\n')

3

.remove('\n')

4

.replace('\n', '')

40

media

41

Multiple Select

Question image

In this lesson I have learned to ...

1

Open files for read access

2

Read lines from text

3

Close a file

42

Open Ended

Question image

Thinking Hard

What have you learned to do today?

What can you do with this new knowledge/skill/understanding?

What do you still need to know?

(press Shift+Enter to take a new line ...)

43

Poll

Question image

How much of this lesson have you understood?

None of it

Some of it

Most of it

All of it

Reading Files

Reading in data from a text file

media

Show answer

Auto Play

Slide 1 / 43

SLIDE