listing17-4.py 152 B

123456
  1. def is_palindrome(text):
  2. n = len(text)
  3. for i in range(len(text)//2):
  4. if text[i] != text[n-i-1]:
  5. return False
  6. return True