본문 바로가기
python-algorithm

leetcode 2469. Convert the Temperature

by 무적김두칠 2023. 1. 6.

https://leetcode.com/problems/convert-the-temperature/description/

 

Convert the Temperature - LeetCode

Convert the Temperature - You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius. You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahr

leetcode.com

 

1
2
3
4
5
6
class Solution:
    def convertTemperature(self, celsius: float) -> List[float]:
        kelvin = celsius + 273.15
        fahrenheit =  celsius * 1.80 + 32.00
        answer = [kelvin, fahrenheit]
        return answer
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 10203 Count Vowels  (0) 2023.01.07
leetcode 2520. Count the Digits That Divide a Number  (0) 2023.01.06
백준 10420 기념일 1  (0) 2023.01.04
백준 5220 Error Detection  (0) 2023.01.04
백준 16316 Baby Bites  (0) 2023.01.04

댓글