Skip to content

Commit ff16a89

Browse files
Shortened conversions/fahrenheit_to_celsius.py
Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 6bf3dca commit ff16a89

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

conversions/fahrenheit_to_celsius.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ def fahrenheit_to_celsius(fahrenheit):
2828
"""
2929
raise TypeError("'str' object cannot be interpreted as integer")
3030

31-
celsius = (fahrenheit - 32) * 5 / 9 # value converted from fahrenheit to celsius
32-
celsius = round(celsius, 2)
33-
# converted (celsius) value is rounded to two decimal places
34-
print(celsius)
31+
return round((fahrenheit - 32) * 5 / 9, 2)
3532

3633

3734
if __name__ == "__main__":

0 commit comments

Comments
 (0)