def palindrome(sentence): if sentence[-1] == sentence[-2]: sentence2 = sentence[::-1] sentence3 = sentence2[2:] new_sentence = sentence + sentence3 print(new_sentence) else: sentence2 = sentence[::-1] sentence3 = sentence2[1:] new_sentence = sentence + sentence3 print(new_sentence) sentence = input("") palindrome(sentence)