''' Purpose: considers the subltety of swapping variable values ''' # get and echo inputs reply = input( 'Enter two words: ' ) w1, w2 = reply.split() print( ) print( 'w1 =', w1 ) print( 'w2 =', w2 ) print() # swap the values of w1 and w2 remember_w1 = w1 # Now we won't lose the old value of w1 # when we reassign w1 to have w2's value w1 = w2 w2 = w1 # print results print( 'After swapping' ) print() print( 'w1 =', w1 ) print( 'w2 =', w2 )