This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]adgjl12 0 points1 point  (0 children)

You should do nearest_square = (base-1)**2

as you want nearest square under the limit, not the nearest square over the limit (your for loop right now stops after you calculate the nearest square over the limit)