Skip Navigation
Canada Learning Code Canada Learning Code
Apply Now Member Login search
    • Workshops & Events
    • Workshops for Organizations
    • Career Collective
  • Volunteer
    • About Us
    • Our Team
      • Annual Report 2023
      • Annual Report 2022
      • Annual Report 2021
      • Annual Report 2020
      • Annual Report 2019
      • Annual Report 2018
      • Annual Report 2017
  • Sponsors
  • Donate
  • Blog
Opens in a new window Opens an external site Opens an external site in a new window
  1. Lessons Plans
  2. / CO2 Trends with Python
#teachers learning code

CO2 Trends with Python

By Paul Prescod 2 hours
Download Lesson
Level
Grades 9-12
Subjects
Science and Technology,
Mathematics
components
  • Programming
  • Data
  • Technology and Society
Tools & Languages
Python,
Trinket

Key Coding Concepts

  • Algorithms
  • Conditional Statements
  • Functions
  • Sequences

Terminology

Library

A bundle of reusable code that allows a programmer to achieve something that would otherwise be difficult or impossible. In this case, easy graphics programming.

Function

A list of statements that can be invoked repeatedly in a program, perhaps changing its behaviour on the basis of “parameters” that are passed in.

In this lesson, learners will use Python and the Pygal graphing library to visualize data about one of the most important issues facing our country: greenhouse gas emissions and their relation to climate change.

Before the lesson...

  • Review key coding concepts and ensure you are confident describing them to your group.
  • Familiarize yourself with Trinket
  • Watch a tutorial of our "CO2 Trends with Python" lesson plan
  • Go through the activity yourself (linked under ‘Lesson’)
  • Optionally: Let the students log into Trinket using Google Accounts, Clever or Edmodo to save their programs easily

  1. If your learners are new to Python, begin with this Python Code-Along “Intro to Computer Science”: http://bit.ly/teenslc-python-code-along
  2. Show learners how to navigate Trinket, as done in the video above. Demonstrate how to edit and run code. Show learners how to navigate within the course using the arrow keys (top, right).
  3. Guide learners along through the Trinket lesson, or have learners progress at their own pace.
  4. Complete the main activity available at: http://bit.ly/trinket-data-vis-python (also linked in the slides)

  • See “Advanced (Optional) Topics” section of Trinket course for Python extensions.
  • Brainstorm how your class can take action. What can we do to help (A) spread awareness, or (B) help solve this issue?

  • Have learners document at least one bug they encountered and how they solved it using the Debug It! Reflection questions in the Creative Computing Curriculum from the Harvard Graduate School of Education.
  • Make a plan for how to access students’ work in Trinket. You could sign up for Trinket Connect (https://trinket.io/schools) to collect projects, have students email you class links, or gather project links in a shared Google doc or blog.
  • Reflect on what we learned from this data:
    • What stood out?
    • What is something new that we learned?
    • What questions do we still have? 

CO2 Trends with Python - Tutorial
https://go.learningcode.ca/python-co2-trends-tutorial

Pygal Documentation
http://www.pygal.org/en/stable/

Smoke Stacks image by Pixabay from Pexels.com
https://www.pexels.com/photo/smoke-stacks-against-blue-sky-257775/

Debug It! Reflections (Creative Computing Curriculum, Unit 2: Animations, Debug It!)
http://scratched.gse.harvard.edu/guide/curriculum.html

Teach lessons that are tied to your existing curriculum! https://bit.ly/CLClessons

r

More Lesson Plans For Grades 9-12

    View All Lesson Plans

    Explore lessons based on components

    The K-12 Computer Science Framework

    Although learning how to build digital projects is a key part of Computer Science education, students should also learn a wider set of skills and competencies that will help them to harness the power of digital technologies as both creators and consumers. A comprehensive approach to K-12 Computer Science education includes learning about the following five focus areas:

    View Framework ➝

    Programming

    By the end of high school, students should be able to create a simple computer program.

    Programming Lessons

    Computing and Networks

    By the end of high school, students should understand and be able to use the tools and devices commonly used to build digital projects.

    Computing and Networks Lessons

    Data

    By the end of high school, students should be able to explain how we use computers to create, store, organize, and analyze data.

    Data Lessons

    Technology and Society

    By the end of high school, students should be able to explore the ways in which technology and society have mutually shaped each other.

    Technology and Society Lessons

    Design

    By the end of high school, students should be able to apply design principles to the digital projects they create.

    Design Lessons

    Get updates to your inbox!

    Be the first to know about new platform features, updates, and exclusive offers.

    "*" indicates required fields

    I'm interested in (Select all that apply)*
    This field is hidden when viewing the form
    In these cities (Select all that apply)
    Canada Learning Code

    The tech we use every day needs to actually work for us all. We explicitly welcome cis women, trans women, trans men, non-binary people, as well as Black, Indigenous and Racialized people, newcomers and people from low-income communities.

     

    2024 Grow with Google High Impact Partner

    • Contact Us
    • Work With Us
    • Blog
    • Sponsors
    • LinkedIn
    • Instagram
    • Facebook
    • Twitter

    © Copyright 2025. All rights reserved.

    CHARITABLE REGISTRATION NO. 834394108RR0001

    • Code of Conduct
    • Accessibility and Inclusion
    • Privacy Policy
    • Terms & Conditions
    • Refund Policy
    • Sitemap