+ 3

Issues writing a program to detect whether a string is a palindrome or not

I have this code, but for some reason it keeps coming up as an error: string=input("Enter string:") if(string==string[::-1]): print("The string is a palindrome") else: print("The string isn't a palindrome")

8th Nov 2017, 1:35 AM
Ceolan McMullin
Ceolan McMullin - avatar
3 Respuestas
+ 1
syntax error. The code doesn't run
8th Nov 2017, 1:50 AM
Ceolan McMullin
Ceolan McMullin - avatar
0
it works fine though
8th Nov 2017, 2:00 AM
Ade Kurniawan
Ade Kurniawan - avatar
0
the code works fine
9th Nov 2017, 12:28 PM
gideon