-
Book Overview & Buying
-
Table Of Contents
Python Illustrated
By :
In this exercise, you’re going to create a function that converts temperatures from Celsius to Fahrenheit and the other way around! By default, the function should assume the input temperature is in Celsius and convert it to Fahrenheit. Think of a clever way to switch conversion modes when necessary and include a docstring.
Here are the temperature conversion formulas you’ll need in this exercise:
Test your function by calling it multiple times to make sure it all works correctly.
One of my students – no names will be mentioned – wrote the following functions to keep track of her remaining treats. She created one function to print the number of treats left and another to update the treat counter when she eats some. However, something...