Match two string : Append « String « Python






Match two string

 

seq1 = "spam" 
seq2 = "scam" 

res = []                                
for x in seq1:                          
    if x in seq2:                       
        res.append(x)                   
print res 

   
  








Related examples in the same category