python

wynnnnnnnnnn 发表于 25天前 · 关联问题 找出车牌号

遍历所有四位数

for num in range(1000, 10000):

s = str(num) if s[0] != s[1]: continue if s[2] != s[3]: continue if s[0] == s[2]: continue sqr = int(num ** 0.5) if sqr * sqr == num: print(num) break