Re: [Tutor] Code for checking whether an input string is a palindrome or not.

2006-10-13 Thread Danny Yoo
>> Yes, you are right; the code isnt working for 'abcdba'; >> So what should I do to rectify it. > > Try walking through the code by hand so you understand why it is > failing. Then maybe you can figure out how to fix it. It's important to > learn to find and fix errors yourself. Hi Asrar, On

Re: [Tutor] Code for checking whether an input string is a palindrome or not.

2006-10-13 Thread Kent Johnson
Asrarahmed Kadri wrote: > Yes, you are right; the code isnt working for 'abcdba'; > So what should I do to rectify it. Try walking through the code by hand so you understand why it is failing. Then maybe you can figure out how to fix it. It's important to learn to find and fix errors yourself.

Re: [Tutor] Code for checking whether an input string is a palindrome or not.

2006-10-13 Thread Kent Johnson
Asrarahmed Kadri wrote: > > Hi, > > Here is a code that reports whether the string is a palindrome or not. I > have posted it to help people new to programming ( i am also a newbie) > to understand the logic and comment on it. > > Share and expand your knowledge as well as understanding... >

Re: [Tutor] Code for checking whether an input string is a palindrome or not.

2006-10-13 Thread Simon Brunning
def pal(spam): return spam == spam[::-1] ;-) -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Code for checking whether an input string is a palindrome or not.

2006-10-13 Thread Asrarahmed Kadri
Hi,   Here is a code that reports whether the string is a palindrome or not. I have posted it to help people new to programming ( i am also a newbie) to understand the logic and comment on it.   Share and expand your knowledge as well as understanding...   Happy scripting   Regards, Asrar   Cod