Functional Libraries

Fred Agbo & Jed

September 4, 2026

Happy Friday!!

  • Today’s Grouping: Scan the QR code or go to https://tools.jedrembold.prof/daily
  • Class code is 2FvLMX
  • Introduce yourselves! Fun question: If you had a magic box that consumed one type of object and output another, what would the inputs and outputs be?

Quick Announcements

  • Feedback from the section meeting this week?
    • Attendance is mandatory
  • Reminder to watch the videos and read the text. They help in better understanding and gives room for class activities
  • Problem Set 1 is due on Monday night!
    • Monday September 7 is Labor Day - NO CLASS
  • Problem Set 2 will be posted on Monday
    • Due the following Monday, September 14th

# Group Problems

Problem 1: The Bureau of Standards

  • Your group is tasked with creating a simple library of conversion functions
  • Each individual should choose one of the conversions to the right, and write two functions: one that converts one direction, and one that converts the other
  • Collect all of these functions together into a single file called conversions.py. It may be useful to use something like a shared Google Doc for quick sharing, or you can just dictate/copy from each other.
  • Feet to Kilometers
  • Pounds to Grams
  • Fahrenheit to Celsius
  • Cups to Liters

Problem 2: Calling BS

  • Now, in a separate file, write a program to solve the following word problem, importing in what functions you need.

Johnny needs his 2000 lb car to travel 2000 feet down the road. He knows that it normally takes 1 cup of gas to move 5000 grams 0.5 kilometers down the road, when the temperature is 20 degrees Celsius. But for each degree Celsius above that, it takes an addition 0.5 liter of gas to move the 5000 grams 0.5 kilometers down the road. It is 83 degrees F outside. How many liters of gas does Johnny need?

Problem 3: The Error Doctor

  • In the materials for today there are three problems named
    • Error1.py
    • Error2.py
    • Error3.py
  • Each contains a function and a comment that explains the expected output. But something is wrong.
  • Identify what is wrong in each case and how you could easily fix it.
// reveal.js plugins