title: Find symmetric words in a text
body: <p>I have to write a function which takes one arguments text containing a block of text in the form of a str, and returns a sorted list of “symmetric” words. A symmetric word is defined as a word where for all values i, the letter i positions from the start of the word and the letter i positions from the end of the word are equi-distant from the respective ends of the alphabet. For example, bevy is a symmetric word as: b (1 position from the start of the word) is the second letter of the alphabet and y (1 position from the end of the word) is the second-last letter of the alphabet; and e (2 positions from the start of the word) is the fifth letter of the alphabet and v (2 positions from the end of the word) is the fifth-last letter of the alphabet.</p>
  
  <p>For example:</p>
  
  <pre><code>&gt;&gt;&gt; symmetrics("boy bread aloz bray")
  ['aloz','boy']
  &gt;&gt;&gt; symmetrics("There is a car and a book;")
  ['a']
  </code></pre>
  
  <p>All I can think about the solution is this but I can't run it since it's wrong:</p>
  
  <pre><code>def symmetrics(text):
      func_char= ",.?!:'\/"
      for letter in text:
          if letter in func_char:
            text = text.replace(letter, ' ') 
      alpha1 = 'abcdefghijklmnopqrstuvwxyz'
      alpha2 = 'zyxwvutsrqponmlkjihgfedcba'
      sym = []
      for word in text.lower().split():
          n = range(0,len(word))
          if word[n] == word[len(word)-1-n]:
              sym.append(word)
          return sym
  </code></pre>
  
  <p>The code above doesn't take into account the position of alpha1 and alpha2 as I don't know how to put it. Is there anyone can help me?</p>