Celsius to Fahrenheit
- O(1) · Trivial
- Free
- Python
- JavaScript
- operations
- decimals
Problem
Write a function that turns degrees Celsius into Fahrenheit. The formula: multiply by 9, divide by 5 and add 32.
Examples
0 → 32
100 → 212
-40 → -40
Besides these, the challenge has hidden tests that are revealed when you submit your solution.
You start with this
Python
def to_fahrenheit(celsius):
passJavaScript
function toFahrenheit(celsius) {
}Solve this challenge
It opens in your browser, with the editor and the tests. It is free and you do not need an account to start.
More O(1) challenges
- Closest to the targetconditionals · comparisons · operations
- Coat or t-shirt?conditionals · strings · comparisons
- Did the fever go down?lists · indexes · booleans
- Did they pass the class?booleans · conditionals
- Digits the other way rounddigits · operations
- Do the two times overlap?conditionals · booleans · comparisons