#NEWLINE# def sharedPrefix( args ) : #NEWLINE# #INDENT# "\n    Find the shared prefix between the strings.\n\n    For instance:\n\n        sharedPrefix(['blahblah', 'blahwhat'])\n\n    returns 'blah'.\n    " #NEWLINE# i = 0 #NEWLINE# while ( i < min ( map ( len , args ) ) ) : #NEWLINE# #INDENT# if ( len ( set ( map ( operator . itemgetter ( i ) , args ) ) ) != 1 ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# i += 1 #NEWLINE# #UNINDENT# return i [ 0 ] [ : i ]