The Python Game Book

code games. learn Python.

User Tools

Site Tools


Sidebar

Github:

en:python:problemsolving:highest_square

find highest square under a given number

If given an integer like n_max = 120, find the highest integer that, if squared, is below n_max

  • Hint: you can square a number in python using the ** operator:

>>>4**2
16

  • Hint: write a function

solution 1: use a for loop

solution 2: think

en/python/problemsolving/highest_square.txt · Last modified: 2020/12/15 18:50 by horst