title: How to compare reverse strings in list of strings with the original list of strings in python?
body: <p>Input a given string and check if any word in that string matches with its reverse in the same string then print that word else print $</p>
  
  <p>I split the string and put the words in a list and then I reversed the words in that list. After that, I couldn't able to compare both the lists.</p>
  
  <pre><code>str = input()
  x = str.split()
  for i in x: # printing i shows the words in the list
      str1 = i[::-1] # printing str1 shows the reverse of words in a new list
      # now how to check if any word of the new list matches to any word of the old list 
      if(i==str):
          print(i)
          break
      else:
          print('$)
  </code></pre>
  
  <p>Input: <code>suman is a si boy</code>.</p>
  
  <p>Output: <code>is</code> ( since reverse of 'is' is present in the same string)</p>