python3 练习题100例 (十七)四位车号问题

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = 'Fan Lijun'

import math

for i in range(1000, 10000):
    n, m = str(math.sqrt(i)).split('.')
    if m == '0' and i//1000 == int(str(i)[1]) and i % 10 == int(str(i)[-2]):
        print(i)
原文地址:https://www.cnblogs.com/LoveBeautiful/p/10030307.html