def first_diff(a, b):
 i = (-1)
 for i in xrange(0, len(a)):
  if (a[i] != b[1]):
   return i
  if (i == 255):
   return i

def first_diff ( a , b ) : i = ( - 1 ) for i in xrange ( 0 , len ( a ) ) : if ( a [ i ] != b [ 1 ] ) : return i if ( i == 255 ) : return i
returns the position of the first differing character in the strings a and b .