tigerstride commited on
Commit
5703381
·
verified ·
1 Parent(s): 61dca5d

Update app.py

Browse files

Convert results to integer

Files changed (1) hide show
  1. app.py +4 -2
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
- return f"Temperature {temperature} degrees in Fahrenheit is {(temperature * 1.8) + 32}"
 
21
  elif convertTo == "C":
22
- return f"Temperature {temperature} degrees in Celsius is {(temperature - 32) * 5/9}"
 
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