Why isn' t this program in python functioning properly for a palandrom Sting detection , please help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why isn' t this program in python functioning properly for a palandrom Sting detection , please help

e = " " a = input(" Enter a string : ") for i in a : e = i + e if a ==e : print ("palandrom string") elif a!= e : print ("Not a palandrom")

12th Sep 2018, 5:15 PM
All World
All World - avatar
4 Answers
+ 6
All World I think what Rahul meant is to replace the space with an empty string ("").
12th Sep 2018, 6:16 PM
Eduardo Petry
Eduardo Petry - avatar
+ 3
@AllWorld, You've done good. Just declare e = "" in the first line. As a single space (" ") also counts. Edit: It works for me https://code.sololearn.com/ch8XWmWmn7hu/#py
12th Sep 2018, 5:32 PM
777
777 - avatar
+ 1
oh now I got it thanks
12th Sep 2018, 6:20 PM
All World
All World - avatar
0
Rahul bro I appreciate your support but it's already there and still not working
12th Sep 2018, 5:37 PM
All World
All World - avatar