Created
February 10, 2017 12:45
-
-
Save M0nica/5c2f0cef7979a2f30ce4ac80ef180a1e to your computer and use it in GitHub Desktop.
This code outputs "The percent change between 500 and 575 is 0%" on Heroku but "The percent change between 500 and 575 is 15%" locally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
original_number = int(request.form['original']) | |
new_number = int(request.form['new']) | |
result = ((new_number - original_number)/int(original_number)) * 100 | |
response = "The percent change between " + str(original_number) + " and " + str(new_number) + " is " + str("%.0f%%" % result) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment