4. Literals or ConstantsΒΆ
There are several types of data.
The simplest ones are called literals or constants.
"""
Fahrenheit, 5, 32 and 9 are literal or constant values.
"""
F = float(input("Fahrenheit: "))
C = 5 * (F - 32) / 9
print("Celsius: %2.1f" % C)
Remember that there are different types of data! for example:
"32"
is not the same as32
.
To compare different types, first perform a conversion.
You have attempted of activities on this page