You are given two given numbers, A and B where 1 <= A <= B, Write a program to find the number of perfect squares in the range A to B (including A and B).
A = int(input())
B = int(input())
count = 0
for i in range(A, B + 1):
if int(i ** 0.5) == i ** 0.5:
count += 1
print(count)
Comments
Leave a comment