>>> str1 ='hchaha'
>>> str2 ='hahahb'
>>>
>>> cmplst = zip(list(str1), list(str2))
>>> print ''.join([a for a, b in cmplst if a==b])
hhah
>>>
>>> str1 ='hchaha'
>>> str2 ='hahahb'
>>>
>>> cmplst = zip(list(str1), list(str2))
>>> print ''.join([a for a, b in cmplst if a==b])
hhah
>>>