Kwame, 'Abena', 'Kofi', 'Ama']` - **Mixed Types List**: `SET record = [

Data Structures - Lists, Tuples, and Dictionaries

Lists: Creation, Indexing, and Slicing

  • Definition: A list is an ordered, mutable (changeable) collection of elements.

    • Ordered: Each element has a fixed position.

    • Mutable: Elements can be added, removed, or changed after creation.

  • Types of Elements in Lists: Lists can hold elements of any type including, but not limited to, numbers, text, or even other lists.

Creation of Lists
  • Empty List:
    SET myList = []

  • List of Numbers:
    SET scores = [85, 72, 91, 60, 78]

  • List of Names:
    `SET students = [