返回顶部

收藏

in a range

更多
from math import sqrt

for n in range(99, 0, -1):
    root = sqrt(n)
    if root == int(root):
        print n
        break

标签:Python,Buildin,Function

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2016-04-23 14:21:41Demo the range function by 风云轩
  2. 2016-05-30 12:59:12Use map by 司马
  3. 2016-08-19 12:01:51Read element in a zipped list by 风云轩
  4. 2016-09-19 20:29:37str Function by xwz
  5. 2016-10-30 09:47:05Here are two ways to write a table of squares and cubes by Solon.Ring
  6. 2017-03-06 09:47:04yield statement: defining a generator function, by Solon.Ring
  7. 2016-03-10 12:03:30range with step by 蟋蟀MM
  8. 2016-04-23 14:41:26range function with steps by jack.chen
  9. 2016-05-30 13:12:18iter: Iterator Types by 蟋蟀MM
  10. 2017-03-06 09:54:00Use int() by 阮小七
  11. 2015-12-29 10:15:31Displaying location, type and value for a sum by 张宋付

发表评论