Created
December 30, 2019 21:17
-
-
Save darmentrout/9e6e67ecf5af9e54f6494c2311e85338 to your computer and use it in GitHub Desktop.
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
# -*- coding: utf-8 -*- | |
# ABV 1.0 12/31/2012 | |
# This is one of my very first side projects as a programmer/developer! | |
print ''' | |
Calculate the Alcohol by Volume (ABV) of your | |
homebrewed beer using the following formula: | |
ABV = ((((OG-FG)*1.05)/FG)/0.79)*100 | |
1.05 g — the amount of CO2 per gram of ethanol produced | |
0.79 g/mL – the density of ethanol alcohol | |
''' | |
OG = input('Enter the Original Gravity (OG): ') | |
Otemp = input(' Temperature (F) at Reading: ') | |
if Otemp < 60: | |
OG = OG - 0.001 | |
elif 70 <= Otemp <= 80: | |
OG = OG + 0.001 | |
elif Otemp > 80: | |
OG = OG + 0.002 | |
FG = input('Enter the Final Gravity (FG): ') | |
Ftemp = input(' Temperature (F) at Reading: ') | |
if Ftemp < 60: | |
FG = FG - 0.001 | |
elif 70 <= Ftemp <= 80: | |
FG = FG + 0.001 | |
elif Ftemp > 80: | |
FG = FG + 0.002 | |
print ''' | |
''' 'ABV = '+str(round(((((OG-FG)*1.05)/FG)/0.79)*100,1))+'''% | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment