Issues writing a program to detect whether a string is a palindrome or not | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

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 Answers
0
It needs to be in Python
8th Nov 2017, 1:47 AM
Ceolan McMullin
Ceolan McMullin - avatar
8th Nov 2017, 1:54 AM
Ade Kurniawan
Ade Kurniawan - avatar
0
Btw, can you post your code here? I want to try your code but I cannot copy it.
8th Nov 2017, 1:56 AM
Ade Kurniawan
Ade Kurniawan - avatar