7Hard
0/15

A program is required to process data from an archaeological dig. The data is stored in a comma-separated value text file named Artifacts.txt

The columns in the data file are:

  • site
  • category
  • depth

Open the file dig_catalog.py and write a program to meet these requirements:

  • Create a primary key for each artifact. A valid key is a single string consisting of (in this order):
    • The first three letters of the site name, converted to uppercase
    • The depth integer divided by 25 (using integer division)
    • The last two letters of the category name
  • Create a record for each artifact. A valid record consists of (in this order):
    • The generated key, the category name (as a string), the depth (as an integer), and the site name (as a string)
  • Store the record for each artifact in a 2D list named artifactCatalog
  • Call the supplied subprogram, renderCatalog(), to show the contents of artifactCatalog
  • The program must work with any number of lines in the data file.

Use comments, white space, and indentation to make your program easy to read and understand.

Do not add any additional functionality.

Save your amended code as dig_catalog_FINISHED.py

Archaeological Data Pipeline

[15]

Input/output Questions

Practise Edexcel GCSE Computer Science Input/output with exam-style questions for GCSE Computer Science. 29 questions covering Accepting and responding to user input, Reading and writing CSV text files, Implementing validation, and Implementing authentication, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Input/output Questions

  1. GCSE
  2. /Computer Science
  3. /Input/output