九州体育网 - 十年信誉网站

关于作者

Discuss / Python / 不必字符串

不必字符串

Topic source

青铜神裔

#1 Created at ...

import math

def is_palindrome(n): length = int(math.log10(n))+1 while length > 1: l = 10**(length-1) if n//l != n%10: return False n = n%l//10 length -= 2 return True


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.