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
It looks like your current script should do it if you fix the typo on the fourth line:
str3 = str3.join(i for i in str1 if i in str2 not in str3)
should be
str3 = str3.join(i for i in str1 if i in str2 and i not in str3)
I wouldn't recommend using a set for this simpy because they don't guarantee order. Your script is also likely to be faster.