bit count or bit set && Python3

Neil Cerutti neilc at norwich.edu
Thu Oct 25 16:04:21 EDT 2012


On 2012-10-25, Neil Cerutti <neilc at norwich.edu> wrote:
> Try defeating the following with arithmetic:
>
> def is_palindrom(n):
>    s = str(n)
>    return s = s[::-1]

Sorry for the typos. It should've been:

def is_palindrome(n):
   s = str(n)
   return s == s[::-1]

-- 
Neil Cerutti



More information about the Python-list mailing list