In [ ]:
In [5]:
Fahrenheit = 32.0
Celsius = (Fahrenheit - 32) * 5.0/9.0
print("Temperature: {F} Fahrenheit = {C} Celsius".format(F=Fahrenheit, C=Celsius))
In [6]:
Celsius = 100.0
Fahrenheit = 9.0/5.0 * Celsius + 32
print("Temperature: {C} Celsius = {F} Fahrenheit".format(F=Fahrenheit, C=Celsius))
In [7]:
%matplotlib inline
import matplotlib.pyplot as plt
In [8]:
def C2F(C):
return 9.0/5.0 * C + 32
C2F(100)
Out[8]:
In [11]:
x = [C2F(c) for c in range(101)]
x[0:10]
Out[11]:
In [12]:
plt.title("Temperature Conversion")
plt.xlabel("Celsius")
plt.ylabel("Fahrenheit")
plt.plot(x)
Out[12]:
In [ ]: