Palindrome
Gerrit Holl
gerrit at nl.linux.org
Thu Nov 13 15:00:02 EST 2003
Runic911 wrote:
> Does anyone know how i can fix my Palindrome program?
A palindrome program?
Are you looking for:
20:58:42:232:0 >>> def ispalindrome(s):
20:58:42:232:0 ... return s == s[::-1]
20:58:42:232:0 ...
20:58:57:232:1 >>> ispalindrome("bolton")
False
20:59:15:232:3 >>> ispalindrome("mooiezepeninepezeioom")
True
20:59:27:232:4 >>> ispalindrome("")
True
?
yours,
Gerrit.
--
276. If he hire a freight-boat, he shall pay two and one-half gerahs
per day.
-- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
http://people.nl.linux.org/~gerrit/
Kom in verzet tegen dit kabinet:
http://www.sp.nl/
More information about the Python-list
mailing list