Trying to write a for function that takes two strings and returns the characters that intersect in the order that they appear in the first string.
Here\'s what I tri
def str_intersection(str1, str2): common_letters = set(str1) & set(str2) str3 = '' for c in str1: if (c in common_letters) and (c not in str3): str3 += c return str3