p occurred twice in the output because of the word apples.
I am trying to modify the code in such a way p is printed once in the output. Thanks
def in_both(word1, word2):
for letter in word1:
if letter not in word2:
print (letter)
print(in_both("apples", "oranges"))
current output:
p
p
l
none
expected output:
p
l
none