Python问题求解答
defisSU(n):foriinrange(2,n):ifn%i==0:returnFalseelse:returnTruedefisHW(n):s=str(n)ifs...
def isSU(n):
for i in range(2,n):
if n%i==0:
return False
else:
return True
def isHW(n):
s=str(n)
if s[::-1]==s:
return True
else:
return False
for n in range(100,1000):
if isSU(n)==True and isHW(n)==True:
print(n)
else:
continue 展开
for i in range(2,n):
if n%i==0:
return False
else:
return True
def isHW(n):
s=str(n)
if s[::-1]==s:
return True
else:
return False
for n in range(100,1000):
if isSU(n)==True and isHW(n)==True:
print(n)
else:
continue 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询