Palindrome

Back to homepage

Project Overview

Write a program that determines if a word (taken as input) is a palindrome. This challenge started 2020 Nov 10 and ended 2020 Nov 17.

Submissions

Shortest possible program

x = input()
print(x[::-1] == x)

Kat Crawford

a = input()
aLength = len(a)
b = a[aLength :: -1]

if a == b:
    print("This is a palindrome")

else:
    print("This is not a palindrome")

Benjamin Lowry

word = input(">")
reverse = ""
i = len(word)
while i > 0:
    reverse += word[i-1]
    i -= 1
print(reverse == word)
        

Will Stark