Language

Data Structures · Lesson 8 of 56

List Examples

Source: 3-Data Structures/3.1.1-ListExamples.ipynb

Start here — no coding background needed

What you will learn

See real-life uses of lists — scores, names, prices.

In simple words

Lists shine when you have many similar things: exam scores, product prices, guest names.

Think of it like this

Class test marks written in a column — average, highest, lowest are easy to loop over.

Ways to store many values together — shopping lists, contacts, unique items.

Easy example — try this first

Easy example — run this first. Change values and press Run again.

Python

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Reference notes (from full bootcamp)

Optional — deeper detail for when you are ready

Real-World Examples Using Lists in Python

Lists are one of the most commonly used data structures in Python, thanks to their versatility and ease of use. Here are several practical examples that illustrate their use in real-world scenarios

Example 1. Manage A To Do List
  • Create a To Do List To Keep Track OF Tasks
Reference example
Python
Output
Expected (from notebook):
Don't forgrt to pay the utility bills
To Do List remaining
-Buy Groceries
-Pay bills
-Schedule meeting
-Go For a Run

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Example 2: Organizing Student Grades
  • Create a list to store and calculate average grades for students
Reference example
Python
Output
Expected (from notebook):
Average Grade: 88.00
Highest Grade: 95
Lowest Grade: 78

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Example 3: Managing An Inventory
  • Use a list to manage inventory items in a store
Reference example
Python
Output
Expected (from notebook):
oranges are in stock.
Inventory List:
- apples
- oranges
- grapes
- strawberries

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Example 4:Collecting User Feedback
  • Use a list to collect and analyze user feedback.
Reference example
Python
Output
Expected (from notebook):
Positive Feedback Count: 2
User Feedback:
- Great service!
- Very satisfied
- Could be better
- Excellent experience
- Not happy with the service

Runs in your browser via Pyodide — no server. First run may take a few seconds.

Practice test — try yourself

Write code, press Check. Wrong answer shows the correct code to copy & run.

You learned "List Examples". Use print() to show: Done: List Examples

Hint: Use one print() with the exact text.

Python