# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---



# Fahrenheit to Celsius
# ===========

# +
Fahrenheit = 32.0

Celsius = (Fahrenheit - 32) * 5.0/9.0

print("Temperature: {F} Fahrenheit = {C} Celsius".format(F=Fahrenheit, C=Celsius))

# -

# Celsius to Fahrenheit
# ===========

# +
Celsius = 100.0

Fahrenheit = 9.0/5.0 * Celsius + 32

print("Temperature: {C} Celsius = {F} Fahrenheit".format(F=Fahrenheit, C=Celsius))

# -

# Plot Example
# =======

# %matplotlib inline
import matplotlib.pyplot as plt


# +
def C2F(C):
    return 9.0/5.0 * C + 32

C2F(100)
# -

x = [C2F(c) for c in range(101)]
x[0:10]


plt.title("Temperature Conversion")
plt.xlabel("Celsius")
plt.ylabel("Fahrenheit")
plt.plot(x)



StarcoderdataJupyterScriptsDedupFiltered