''' Purpose: introduce relational operators ''' # get two numbers from user print() sa = input( 'Enter number: ' ) sb = input( 'Enter number: ' ) print() # convert inputs to integer # a = int( sa ) # b = int( sb ) a = sa b = sb # compare and record results # a logical operator b -> True/False (NOT STRINGS OF True/False) # Good question! It's a Boolean (a boolean is a logical value - # in python our booleans are True/False) b1 = ( a < b ) # < is less than # t1 = type(b1) # print(t1) b2 = ( a > b ) # > is greater than b3 = ( a <= b ) # <= is less than or equal to b4 = ( a >= b ) # >= is greater than or equal to b5 = ( a == b ) # == is equals # (one equal is assignment 2 is a logical operator) b6 = ( a != b ) # != is not equals # display results print( a, '< ', b, ':', b1 ) print( a, '> ', b, ':', b2 ) print() print( a, '<=', b, ':', b3 ) print( a, '>=', b, ':', b4 ) print() print( a, '==', b, ':', b5 ) print( a, '!=', b, ':', b6 ) print()