''' 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 # get pH level of interst reply = input( 'Enter pH level: ' ) pH = float( reply ) # We make the string input a float # so that we can convert strings of floats into floats print( ) # Reminder that True/False are boolean values in Python. # Logical expressions using relation operators (check out can_you_relate.py) # give you either the value True or the value False! # determine whether sample is acidic is_acidic = ( pH < ACIDIC_THRESHOLD ) # gives you True/False # 7 (pH entered) is not less than 7 (ACIDIC_THRESHOLD) -> False # 6 (pH entered) < 7 (ACIDIC_THRESHOLD) -> True (acidic!) # 12 (pH entered)< 7 (ACIDIC_THRESHOLD) -> False (not acidic!) # We can print "basic" for basic PHs and "acidic" for acidic PHs # butttt we will need an if statement... sooo wait like 5 mins. :) # print result print( is_acidic ) # all done