This is a simple palindrome checker. The code works for numbers, but not strings.
x = str(input("Enter a number: "))
if x == x[::-1]:
print x + " is a palindrome!"
else:
print x + " is not a palindrome!"
When I try inputting a string, I get this error:
File "palindrome.py", line 1, in <module>
x = str(input("Enter a number: "))
File "<string>", line 1, in <module>
NameError: name 'abba' is not defined