Skip to main content

Back to the full dot-point answer

EnglandComputer ScienceQuick questions

Topic 6: Problem solving with programming

Quick questions on Input, output and CSV files: reading and writing text files in Python - Edexcel GCSE Computer Science

3short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.

What is not stripping the newline?
Show answer
Lines read from a file include a "\n"; use .strip() before splitting or comparing, or it can cause mismatches.
What is not closing the file?
Show answer
Always close() the file; otherwise written data may not be saved and the file may stay locked.
What is q1?
Show answer
State what input() returns in Python. [1 mark]

Have a question we have not covered?

This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.

All Computer ScienceQ&A pages