def volume(x): cote = 140-2*x return cote*cote*x def aire(x): return 140*140-4*x**2 def table() : for x in range(0, 72, 10): print (x, aire(x)) a = 23.3332 # x minimal b = 23.3334 # x maximal pas = (b - a) / 100 # pas entre 2 valeurs de x x = a # première valeur de x qui évoluera x_max = x # antécédent provisoire du max v_max = volume(x) # volume max provisoire for compt in range(100) :# répéter 100 fois x = x + pas # x suivant v_x = volume(x) # volume pour x if v_x > v_max : # si ... x_max = x # change antécédent du max v_max = v_x # change volume max print (round(pas,6), round(x_max,6), v_max) # affichage