fork download
  1. def czy_palindrom(s):
  2. for i in range(len(s) // 2):
  3. if s[i] != s[-i - 1]:
  4. return False
  5. return True
  6. print(czy_palindrom("aabbaa")) # True
  7. print(czy_palindrom("aaxyaa")) # False
  8.  
Success #stdin #stdout 0.08s 14088KB
stdin
Standard input is empty
stdout
True
False