Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def h(x):
- return -4 * x ** 2 + 4 * x + 3
- def find_max_of_h():
- xMax, yMax = 0, 0
- x = 0
- while x <= 3:
- y = h(x)
- if y > yMax:
- yMax = y
- xMax = x
- x += 0.1
- return xMax, yMax
- max_x, max_y = find_max_of_h()
- print(f"La valeur maximale de h(x) est {max_y} pour x = {max_x}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement