Hey so I want to write code for finding nearest square number less than or equal to a certain number(x). I've tried the following:
m = 0
base = 0
while m <= x:
if m > x:
break
m = base**2
base += 1
print(m)
This, however, gives the nearest square right after the number x despite putting the break since a m > x has already been assigned to m. how i do stop the loop before m > x?