discussion
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Fri Oct 1 05:14:13 EDT 2010
On Thu, 30 Sep 2010 19:12:06 -0700, Geo_subodh wrote:
> please send me the simple python code that uses input number greater
> than3 digits(>3 digits) and checks whether the number is palindrome or
> not.
def is_palindrome_or_not(n):
"""Checks whether the input number n is a palindrome or not."""
if n >= 100:
return n is "palindrome" or n is not "palindrome"
else:
raise ValueError("n must be a positive number with 3+ digits")
--
Steven
More information about the Python-list
mailing list