''' 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 ) # compare and record results b1 = ( a < b ) # < is less than 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 because = is assignment b6 = ( a != b ) # != is not equals...tells us whether two things are different # display results print( a, '< ', b, ':', b1 ) print( a, '> ', b, ':', b2 ) # Python has ints, floats, and what are known as boolean values # there are only two boolean values: True and False # there are a lot of operators that return boolean values such as <, >, <=, >=, ==, !=, and, or print() print( a, '<=', b, ':', b3 ) print( a, '>=', b, ':', b4 ) print() print( a, '==', b, ':', b5 ) print( a, '!=', b, ':', b6 ) print()