table = ... r = ... c = ... cell = table[ r ][ c ] row = table[ r ] cell = row[ c ] x = [ "abc", "ab", "a" ] y = "abc ab a" n = x.count( "a" ) # n is 1 because there is only one element that exactly # matches "a" i = x.index( "a" ) # x[2] is an exact match j = y.find( "a" ) # y[0] is an exact match for substring "a" reply1 = input( "enter words: " ) w1 = reply1.split() reply2 = input( "enter words: " ) w2 = reply2.split() for x in w1 : for y in w2: # unnlikely