''' Purpose: quick refresher on Boolean calculations ''' # determine whether its input pH level is acidic; i.e., less than 7.0 # acidity limit ACIDIC_THRESHOLD = 7.0 # samples less than threshold are acidic # this is all in caps because it is a constant value. it will never change throughout our code # get pH level of interst reply = input( 'Enter pH level: ' ) pH = float( reply ) # converts the pH value to a decimal (float) value # python cannot represent infinite digits, so this number will be an approximation # if you write 6.99999999 and put enough 9s, it might end up rounding the number # the takeaway from this is to take caution when working with floats in python and to not put 20 decimal places print( ) # determine whether sample is acidic is_acidic = ( pH < ACIDIC_THRESHOLD ) # this is a comparison, so is_acidic is going to be a boolean value or True or False # print result print( is_acidic ) # all done