title: Recursion error when checking if string is a palindrome
body: <p>I have written down this code which checks whether a string is palindrome or not but on execution the output displays a "recursion error". How can I resolve this issue?    </p>
  
  <pre><code>def palindrome(string):
      if len(string) &lt; 1:
          return True
      else:
          if string[0] == string[-1]:
              return palindrome(string[::-1])
          else:
              return False
  
  string = input("Enter a string:")
  if palindrome(string)==True:
      print("String is palindrome")
  else:
      print("String is not palindrome:")
  </code></pre>