Answer:
import math
def isPerfectSquare(n):
s = int(math.sqrt(n))
return n == s*s
def countPerfectSquares(k,m):
q = 0
for i in range(k,m):
if isPerfectSquare(i):
q=q+1
return q
print(countPerfectSquares(10,40))
Step-by-step explanation:
Note that this is including the k, but excluding m. If you want to include m, write m+1 in the range expression.