Celsius to Fahrenheit
Programming Basics · Python
TASK
Problem
Given Celsius temperature `c`, convert it to Fahrenheit using `F = C * 9 / 5 + 32`.
EXAMPLE
Example
25
77.0
LIMITS
Constraints
c ≥ -273.15
LEARN
Theory for this problem
+
`input()` reads data entered by the user. The result of `input()` is initially a string. `float()` converts a numeric string into a number that may contain a decimal part. The `+` operator adds numbers. The `*` operator multiplies numbers. The `/` operator performs regular division and may return a decimal number. `print()` displays the program result. Print only what the problem statement requires.
**Connection to this task.** The `/` operator performs true division and returns a floating-point value in Python. This matters for averages, percentages, and formulas whose result may be fractional. The expression `c * 9 / 5 + 32` shows how this idea is applied to the task data.
NEED HELP?
Hints
+
['Substitute the value into the formula from the statement.']
ANSWER
Solution
+
c = float(input()) result = c * 9 / 5 + 32 print(result)