string = input().lower()
      size = len(string)
      if size%2==0:
        strn=''
        for i in range(int(size/2)):
          strn+=string[i]
        if strn+strn[::-1]==string:
          print("It's a palindrome")
        else:
          print("It's not a palindrome")
      else:
        strn=''
        for i in range(int(size/2)):
          strn+=string[i]
        if strn+string[i+1]+strn[::-1]==string:
          print("It's a palindrome")
        else:
          print("It's not a palindrome")
      
      Python language logo

      Check a String is a Palindrome or not in Python

      0

      0

      avatar
      drzyadav

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.