Read files (Edexcel GCSE Computer Science): Quizzes

📚Quizzes
Read files
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

12 questions from this quiz

Show

Why must data be read into memory before a program can use it?

Programs can only work with data in RAM

What does CSV stand for in file formats?

Comma Separated Values

In a CSV file, how are different fields within a record separated?

By commas

What are carriage return and line feed characters used for in text files?

Tell computer where lines end & begin

What does the strip() function do when reading file data?

Removes invisible end-of-line chars

What does 'r' mean in the code: file = open('Prizes.txt', 'r')?

Read mode (read-only)

What does line.split(',') do to the string 'Bear,123,4.5'?

Creates ['Bear', '123', '4.5']

When you read data from a text file, what data type is it initially?

String (even numbers)

What must you do with '4.25' read from a file before using it in price calculations?

Convert it to float

What does prizeTable.append(prize) create when used repeatedly?

A two-dimensional list (list of lists)

Why must you use file.close() after reading a file?

To free up system resources

What file mode mistake would overwrite your file instead of reading it?

Using 'w' instead of 'r'

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

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