Skip to content

Instantly share code, notes, and snippets.

@CaryInVictoria
Last active December 25, 2015 17:39
Show Gist options
  • Save CaryInVictoria/7014532 to your computer and use it in GitHub Desktop.
Save CaryInVictoria/7014532 to your computer and use it in GitHub Desktop.
Farenheit to celcius
def farenheit_to_celsius(f):
return ((f-32)*5/9)
f = 70
# Was print(str(f) + 'F -> ' + '%2.1f' % (farenheit_to_celsius(f)) + 'C') # => 70F -> 21.1C
# Now, as per Victor's suggestion:
print('%2.1fF -> %2.1fC' % (f, farenheit_to_celsius(f))) # => 70.0F -> 21.1C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment