Introduction
Welcome to the Nuevo Sports League! Meet Coach Luna, the organizer of the league’s big championship game. Six teams from six different cities are competing, and Coach Luna has one big question:
Which city should host the championship?
To answer it, she needs to look at data. Data is information we collect, like how many people live in a city or how many seats a stadium has. Data science is the job of using data to answer questions and make smart decisions. Data scientists do this for sports teams, hospitals, cities, and video games every day!
In this workshop you will become Coach Luna’s data scientist. You will use Python to store population data, calculate totals and averages, sort cities into groups, draw charts, and finally pick the championship host.
What you will learn
By the end of this workshop you will be able to:
- Store a table of data in Python lists
- Use loops to add up and average numbers
- Use
ifstatements to sort data into groups - Draw a simple chart from data
- Apply these skills to population data to answer a real question
Prerequisites
You should have seen Python before: printing text and using variables. No other experience is needed.
What you need
You only need a web browser and an internet connection. Each activity includes a free Codebunga Python editor that loads on the page, with no account needed.
Copy the activity’s complete starting program, select all existing code in its editor, and paste to replace it. Press Run to see the output, then edit the program to try the challenge. Each editor starts with a shared “Hello, World!” program, not the activity’s code. Keep a copy of your work before leaving the page; edits do not carry between activities. If the editor does not load, use the fallback link below it.
The team cities and populations in this workshop are made up so we can practice. In the final activity you will swap in data about a place you care about!
Make it yours
Love soccer, basketball, or a different sport? Rename the teams and cities in Activity 1 to match your favorites. Everything else in the workshop still works.