Last active
February 2, 2017 18:43
-
-
Save matthewjberger/7315043f9b11f67aa84f22642365b180 to your computer and use it in GitHub Desktop.
An algorithm to approximate bodyfat percentage - https://repl.it/EtYI/2
This file contains hidden or 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
def calcBf(weightLbs, waistGirthAroundBellyButton): | |
m = 1.082 * weightLbs | |
n = 4.15 * waistGirthAroundBellyButton | |
bfLbs = 94.42 + m - n | |
bfDiffLbs = abs(weightLbs - bfLbs) | |
bfPercent = 100 * (bfDiffLbs/weightLbs) | |
print("You are " + "{0:.2f}".format(bfPercent) +"% bodyfat") | |
calcBf(156, 33) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment