0

finding the missing alphabet in a palindrome series.in the below code i could not understand the looping condition .can any one

inputstr = input().strip() fwdindex = 0 revindex = len(inputstr)-1 while(fwdindex != revindex): if inputstr[fwdindex] != inputstr[revindex]: if inputstr[fwdindex] == inputstr[revindex-1] and fwdindex != revindex-1: print (inputstr[revindex]) else: print (inputstr[fwdindex]) break fwdindex+=1 revindex-=1

6th Jul 2018, 5:53 AM
Gokula Krishnan S
Gokula Krishnan S - avatar
2 Réponses
+ 2
it seems like, its homework wow, if that so, then your code is too complicated im too kind today, so i will give u the code https://code.sololearn.com/c8xk05QAsbAI/?ref=app now look, even now i give you the code, dont lazy. your question is good, but not clear. next, if you want to ask question again, dont ask them the code. ask the hint :v but like i said before, im too kind today. so, happy coding :v
6th Jul 2018, 4:27 PM
Kevin AS
Kevin AS - avatar
0
this code is about that in a palindrome series for eg."malayalam" if the input is like"malayala" then i have to find the the missing character in the palindrome which is "m" in this case.here in this code i could not understand the outer looping conditions
6th Jul 2018, 3:55 PM
Gokula Krishnan S
Gokula Krishnan S - avatar