Take two string arguments and return a string with only the characters that are in both of the argument strings in python
<pre><code>def same_letters():

word1 = ''

word2 = ''

word1 = str(input("Please enter first word:"))
word2 = str(input("Please enter second word:"))

if word1 != word2:
    for letter in word1:
        for character in word2:
            word1 = word1.replace(character, "")


print(word1)
</code></pre>

<p>This is what I have so far; I want to be able to display the answer like so:</p>

<p>Please enter first word: space</p>

<p>Please enter second word: spot</p>

<p>sp</p>

<p>Instead when I run this program I get the opposite instead of getting the letters that are in both string arguments I get "ace" and if I switch it around I get "ot" I cannot for the life of me figure out how to display the same characters.</p>

<p>thanks for any help</p>
