An environmental monitoring station uses a one-dimensional list to record the pH levels of a river. The pH level is measured four times a day (every six hours). This data needs to be saved to an external CSV file where each line of the file represents one day of monitoring (exactly four pH readings).
An existing Python program contains the following data structure:
ph_levels = [
7.2, 7.15, 6.9, 7.05,
6.8, 6.75, 6.6, 6.55,
7.1, 7.3, 7.25, 7.4,
6.95, 6.85, 6.9, 7.0,
7.12, 7.18, 7.22, 7.15,
6.85, 6.9, 6.75, 6.7
]
Write a program to meet these requirements:
ph_levels data structureHere is the expected content of the file RIVER_PH.CSV:
7.2,7.15,6.9,7.05
6.8,6.75,6.6,6.55
7.1,7.3,7.25,7.4
6.95,6.85,6.9,7.0
7.12,7.18,7.22,7.15
6.85,6.9,6.75,6.7
Do not add any additional functionality to your code.
Use comments, white space, indentation, and meaningful variable names to make the program readable.
25 exam-style questions on Edexcel GCSE Computer Science Input/output, covering Accepting and responding to user input, Reading and writing CSV text files, Implementing validation, and Implementing authentication. Each one has a worked solution and a mark scheme showing where the marks go.