Instruction

Use the offline Python IDLE to program below (download from Python if you have not installed):

Download Python

AO1 – Knowledge & Understanding

  1. list_literals.py

    Write a program that creates a Python list containing exactly 5 integers. Print the list to check its values.

  2. two_d_list.py

    Create a 2-D list with 2 rows and 3 columns of strings (e.g., names of fruits). Print the 2-D list to confirm the structure.

  3. access_update.py

    Create a list of scores [12, 18, 9, 21, 15]. Then:


AO2 – Applying Knowledge

  1. list_methods.py

    Start with data = [4, 5].

  2. trace_output.py

    Copy this list into your program: names = ["Ava", "Ben", "Chen", "Dia"].

    Add print statements to show what happens when:

  3. fix_error.py

    The following code contains an error. Run it, explain the error in comments, then correct it:

    items = [2, 3, 5]
    items[3] = 7
    

AO3 – Problem-Solving & Analysis

  1. two_d_indexing.py

    Use the following 2D list:

    grid = [
        [2, 4, 6],
        [1, 3, 5]
    ]
    
  2. why_lists.py

    Write a short program that stores five test scores in a list.

    In a comment at the end, explain why using a list is better than using five separate variables.

  3. slicing.py

    Start with nums = [10, 20, 30, 40, 50].

    Write a program that slices the list to return [20, 30, 40]. Print the result.

Submission

Submit all the .py files here: