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)

 

posted on 2018-11-28 09:30  daxia5398  阅读(214)  评论(0编辑  收藏  举报

导航