We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5888590 commit 0c46245Copy full SHA for 0c46245
python/easy/2469. Convert the Temperature.py
@@ -0,0 +1,12 @@
1
+class Solution:
2
+ def convertTemperature(self, celsius: float) -> List[float]:
3
+ """
4
+ convertTemperature returns temperature in Kelvin and Fahrenheit when given Celsius input
5
+ celsius: float (0 <= celsius <= 1000)
6
7
+ kelvin_fahrenheit_array = [] #create array for kelvin and fahrenheit results
8
+ kelvin = celsius + 273.15 #calculate kelvin
9
+ kelvin_fahrenheit_array.append(kelvin) #add kelvin to array
10
+ fahrenheit = celsius * 1.80 + 32.00 #calculate fahrenheit
11
+ kelvin_fahrenheit_array.append(fahrenheit) #add fahrenheit to array
12
+ return kelvin_fahrenheit_array
0 commit comments