''' Purpose: demonstrate arithmetic and use of variables for naming things ''' # name some values # equals is assignment a = 13 b = 5 # This will print with a space after the equals because of the comma. print( "a =", a ) print( "b =", b ) input() # display some integer calculations print( 'Integer arithmetic' ) total = a + b difference = a - b product = a * b dec_quotient = a / b int_quotient = a // b remainder = a % b power = a ** b print( 'a + b =', total ) print( 'a - b =', difference ) print( 'a * b =', product ) print( 'a / b =', dec_quotient ) print( 'a // b =', int_quotient ) print( 'a % b =', remainder ) print( 'a ** b =', power ) input() # introduce some other built-in functions print( 'Some handy functions' ) # below are variables (values that are stored at a name for reuse ) c = -10 d = 1.75 e = -1.75 # This prints out two things: the string "c ="n and the value stored at the variable c print( "c =", c ) print( "d =", d ) print( "e =", e ) input() abs_c = abs( c ) # absolute value float_c = float( c ) # hands back the decimal version of the number in the parens int_d = int( d ) # hands back the integer version of the number in the parens print( 'abs( c ) =', abs_c ) print( 'float( c ) =', float_c ) print( 'int( d ) =', int_d ) print() # No binary in this class!