# Inputs Original and Final Salinity in Per mille (‰ )

# Outputs Final ABV

# Produced 24/09/2016

def salinity2brix ( salinity ) :

Brix = 1.187 *salinity

return Brix

OS = int ( input ( 'What was your original Salinity reading?' ) ) / 10

FS = int ( input ( 'What is your final salinity reading?' ) ) / 10

OB = salinity2brix ( OS )

FB = salinity2brix ( FS )

OG = ( OB / ( 258.6 - ( ( OB / 258.2 ) * 227.1 ) ) ) + 1

FG = 1.001843 - 0.002318474 *OB - 0.000007775 *OB*OB - 0.000000034 *OB*OB*OB + 0.00574 *FB + 0.00003344 *FB*FB + 0.000000086 *FB*FB*FB

abv = ( OG - FG ) * 131.25100

print ( "your ABV is ~" , abv )