It is decision time! Coach Luna must choose the championship host city. A good host has more expected fans than stadium seats, so every seat gets filled and fans are excited. You will combine everything you learned: lists, loops, if statements, and charts.
Here is a third list with each team’s stadium seats:
| Team | Seats |
|---|---|
| Harbor Hawks | 30000 |
| Mesa Mustangs | 20000 |
| Pine Ridge Pumas | 8000 |
| Sunset Sharks | 45000 |
| Lakeside Lynx | 15000 |
| Canyon Coyotes | 5000 |
For each team, we compute extra fans = expected fans - seats. A positive number means extra fans who could not fit. The host is the city with the largest extra fans.
Steps
- Replace all existing code in the editor below with this complete program, then press Run:
teams = ["Harbor Hawks", "Mesa Mustangs", "Pine Ridge Pumas", "Sunset Sharks", "Lakeside Lynx", "Canyon Coyotes"]
populations = [820000, 450000, 95000, 1200000, 310000, 60000]
seats = [30000, 20000, 8000, 45000, 15000, 5000]
host = 0
most_extra = -1000000
for i in range(len(teams)):
fans = populations[i] // 20
extra = fans - seats[i]
print(teams[i], "has", extra, "extra fans")
if extra > most_extra:
most_extra = extra
host = i
print("The championship host is the", teams[host], "!")
Can’t see the editor? Open Codebunga in a new tab.
- You should see that the Sunset Sharks win with 15000 extra fans.
- Notice
most_extra = -1000000. We start with a very small number so the first team always beats it.
Final challenge: your own data
Now be the data scientist! Replace the lists with data about a place you care about. Ideas:
- The populations of six cities or countries you looked up online, plus seat counts of local arenas
- Your school’s teams and how many students are in each grade
- Your own fantasy league with made-up numbers
Then:
- Print the total and average of your population list.
- Label each item Big, Medium, or Small using rules you choose.
- Draw a bar chart of your data.
- Write one sentence in a comment, starting with
#, that answers the question: What did the data tell you?
Keep your lists the same length, and keep matching items at matching positions. If you get an IndexError, one list is probably shorter than another.
If your data comes from the internet, ask a teacher or adult to help check that the source is trustworthy, and write down where it came from. Good data scientists always cite their sources!
Congratulations! You helped Coach Luna choose her champion city and learned how data scientists think.

You did it!
Workshop complete