The function Celsius2Fahrenheit will convert Celsius to Fahrenheit to be used later, and the range is supposed to go up each time by .5, and stop at 101, but you cant use a float value in range, (I am a beginner at python), can someone please help.
def Celsius2Fahrenheit(c):
""" This will Convert c Celsius to its Fahrenheit equivalent"""
return c * 9 / 5 + 32
for x in range(0,101,.5):
# This will print the values using new style formatting
e = Celsius2Fahrenheit(x)
if (e > 0):
print(" {:3.1f} (C) | {:6.2f} (F) ".format(x,e))
else:
print(" {:3.1f} (C) | {:6.2f} (F) ".format(x,e))