Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Shortened conversions/fahrenheit_to_celsius.py
Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
karimzakir02 and cclauss authored Jul 9, 2020
commit ff16a89bfe37f87625a3274a2f3aad160e6a4664
5 changes: 1 addition & 4 deletions conversions/fahrenheit_to_celsius.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ def fahrenheit_to_celsius(fahrenheit):
"""
raise TypeError("'str' object cannot be interpreted as integer")

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


if __name__ == "__main__":
Expand Down