Read the question, write Python on the right, then Run or Check.
QuestionHint and solution stay closed until you open them
Read a temperature in Celsius (it may have a decimal point) and print it in Fahrenheit.
The formula is F = C × 9/5 + 32. Print the result with exactly one digit after the decimal point.
Input. One line: a number (int or float).
Output. Fahrenheit, one decimal place, e.g. 98.6
Constraints
- -273.15 ≤ C ≤ 1000
Examples
Input
37
Output
98.6
Input
100
Output
212.0
Hint
- Read with float(input()) so decimals survive.
- In Python 3, 9 / 5 is 1.8. Using 9 // 5 would truncate to 1 and give the wrong answer.
- Format with an f-string: f"{f:.1f}".
Show correct code
Peek only after you have tried. You can still Check your own version.
c = float(input())
print(f"{c * 9 / 5 + 32:.1f}")
main.pyPython · Ctrl + Enter runs
ResultIdle
Run to see output. Check grades the tests.