''' Purpose: considers how Python stores and keeps track of variables ''' # get inputs into proper form (string and integer) w = input( 'Enter word: ' ) si = input( 'Enter integer: ' ) sd = input( 'Enter decimal: ' ) print() print( 'w: ', w ) print( 'si: ', si ) print( 'sd: ', sd ) print() w_type = type( w ) w_id = id( w ) si_type = type( si ) si_id = id( si ) sd_type = type( sd ) sd_id = id( sd ) # display what we found out print( 'variable w is', w_type, 'and is at', w_id, 'and when printed displays', w ) print( 'variable si is', si_type, 'and is at', si_id, 'and when printed displays', si ) print( 'variable sd is', sd_type, 'and is at', sd_id, 'and when printed displays', sd ) print() # let's cast (convert) si and sd respectively into an integer and decimal i = int( si ) d = float( sd ) print( 'i: ', i ) print( 'd: ', d ) print() i_type = type( i ) i_id = id( i ) d_type = type( d ) d_id = id( d ) # display what we found out print( 'variable i is', i_type, 'and is at', i_id, 'and when printed displays', i) print( 'variable d is', d_type, 'and is at', d_id, 'and when printed displays', d )