isPalindrome function in Python

I’ve started playing around with Python, and the more I do the more I like it.  Python makes it very easy to do simple, scripty type stuff, but also has the ability to do OOP if that need arises.

Here’s a quick little function to determine if a string passed is a palindrome or not.

def isPalidrome(theWord):
	return (theWord==theWord[::-1])
This entry was posted in Programming and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>