Tag Archives: Grocery store

Python judge perfect square number

— coding: utf-8 —
# # Integer-coding:
+ 100 + 268 is a perfect square
# + coding: utf-8 —
#
from math import sqrt
def f(number):
for x in range(0,number):
m=sqrt(x+100)
n=sqrt(x+268)
if mint(m) and nint(n):
print x
If name = = “main” :
f (1000).
Running results:
21
261