Advertisement
AssoAndrea

min/max of function

Jun 9th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. function = "x**2 + 2"
  2. results = list()
  3. for x in range(-100,100):
  4. results.append(eval(function))
  5.  
  6. print(max(results))
  7. print(min(results))
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement