Read files (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Read files
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

13 cards from this deck

Show

Why must data be read into memory?

Programs can only process data in RAM, not directly from storage

Memory (RAM) vs Storage characteristics

Memory: fast & temporary. Storage: permanent but can't use directly

What is a record in a file?

Information about one item, stored on a separate line

What are fields in a record?

Different pieces of information separated by commas within a record

What CSV stands for

Comma Separated Values

Purpose of carriage return & line feed

Invisible characters showing where lines end/begin

What strip() function does

Removes invisible carriage return & line feed from line ends

Meaning of 'r' in open(filename, 'r')

Read mode (read-only)

What split(',') does to a line

Breaks line at commas, creates a list of separate pieces

Data type of all items read from text file

String (text) - even numbers

Why convert data types after reading files

Everything is initially string; need correct type for calculations

Purpose of file.close()

Closes file when finished to free system resources

File mode for reading (not writing)

Use 'r' not 'w' (w would overwrite file)

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.