Created
August 26, 2021 17:17
-
-
Save pamelafox/6ced4d353e229bc01f7d5b0820472b28 to your computer and use it in GitHub Desktop.
Temperature converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How can we communicate the highs and lows of climate change with people who use a different temperature unit? | |
Let's make a temperature converter based on the steps here: | |
https://www.mathsisfun.com/temperature-conversion.html | |
Create a function called celsius_to_fahrenheit that: | |
* takes a single argument, the temperature in celsius | |
* calculates and returns the fahrenheit equivalent | |
Similarly, create another function called fahrenheiht_to_celsius that: | |
* takes a single argument, the temperature in fahrenheit | |
* calculates and returns the celsius equivalent | |
""" | |
# This def statement may be incomplete... | |
def celsius_to_fahrenheit(): | |
""" | |
>>> celsius_to_fahrenheit(0) | |
32 | |
>>> celsius_to_fahrenheit(100) | |
212 | |
""" | |
# YOUR CODE HERE | |
# This def statement may be incomplete... | |
def fahrenheit_to_celsius(): | |
""" | |
>>> fahrenheit_to_celsius(32) | |
0 | |
>>> fahrenheit_to_celsius(212) | |
100 | |
""" | |
# YOUR CODE HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment