Spaces:
Runtime error
Runtime error
Update app.py
Browse filesConvert results to integer
app.py
CHANGED
|
@@ -17,9 +17,11 @@ def celcius_tool(convertTo:str, temperature:int)-> str: #it's important to speci
|
|
| 17 |
temperature: Convert the temperature to either F or C, as specified
|
| 18 |
"""
|
| 19 |
if convertTo == "F":
|
| 20 |
-
|
|
|
|
| 21 |
elif convertTo == "C":
|
| 22 |
-
|
|
|
|
| 23 |
else:
|
| 24 |
return f"ERROR convertTo must be either C or F"
|
| 25 |
|
|
|
|
| 17 |
temperature: Convert the temperature to either F or C, as specified
|
| 18 |
"""
|
| 19 |
if convertTo == "F":
|
| 20 |
+
result = int((temperature * 1.8) + 32)
|
| 21 |
+
return f"temperature} degrees in Fahrenheit is {result}"
|
| 22 |
elif convertTo == "C":
|
| 23 |
+
result = int((temperature - 32) * 5/9)
|
| 24 |
+
return f"Temperature {temperature} degrees in Celsius is {result}"
|
| 25 |
else:
|
| 26 |
return f"ERROR convertTo must be either C or F"
|
| 27 |
|