Ctrl K

Celsius to Other Scales

Easy
A weather station reports the temperature degrees in Celsius, a non-negative number with at most two decimal places. Convert it to Kelvin and to Fahrenheit and return the list [kelvin, fahrenheit]. The conversion formulas are: - kelvin = degrees + 273.15 - fahrenheit = degrees · 1.8 + 32 An answer is accepted if each number is within 10⁻⁵ of the exact value.
Example 1
degrees=25.0 → [298.15, 77.0]

25 + 273.15 = 298.15 K; 25 · 1.8 + 32 = 77 °F.

Example 2
degrees=37.5 → [310.65, 99.5]

37.5 + 273.15 = 310.65 K; 37.5 · 1.8 + 32 = 99.5 °F.

Constraints
  • 0 ≤ degrees ≤ 1000
  • degrees has at most two decimal places
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsA Number That Reads Both Ways EasyValue of a Roman Numeral EasyAdd One to a Digit Array EasySum of Binary Strings EasyWhole Square Root Easy
loading Python…
Input
degrees=25.0
Expected
[298.15, 77.0]

Run checks the first 3 tests in your browser. Submit checks all 36 tests on the server, hidden ones included.