What does this code?

Prompt novice how the code works in Python.
I tried to describe what I understand in every line.
``````from scipy.optimize import rosen, differential_evolution #Import libraries
bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)] #Specify the list of data
result = differential_evolution(rosen, bounds) #Assign a variable a value ? what?
result.x, result.fun # Not understood the meaning
from scipy.differential_evolution import optimize # import differential_evolution Again
import numpy as np # import numpy reducing np
def ackley(x): #defines function ackley from x
arg1 = -0.2 * np.sqrt(0.5 * (x[0] ** 2 + x[1] ** 2))
arg2 = 0.5 * (np.cos(2. * np.pi * x[0]) + np.cos(2. * np.pi * x[1]))
return -20. * np.exp(arg1) - np.exp(arg2) + 20. + np.e
bounds = [(-5, 5), (-5, 5)] #Set a list of bounds
result = differential_evolution(ackley, bounds) # What is assigned?
result.x, result.fun # And then?
print(result.x, result.fun)``````
June 14th 19 at 18:49
June 14th 19 at 18:51
1. learn the basics of python, and only then move on to more complex examples
2. open the documentation for scipy, read what parameters it uses, and which returns a function differential_evolution
And then there is do not understand, do you not understand how the python function is called, or how exactly to use the function differential_evolution

just result.x, result.fun don't need, maybe it did in the console to check the result
the second time to import differential_evolution don't, it's likely you have collected from two different scripts