It seems that the inbuilt min()
function for determining the minimum value in a given iterable. I have this line of code:
result = min(cost+futureCost(newState) \
for action, newState, cost in problem.succAndCost(state))
where newState
is of integer type and the function futureCost()
returns an integer. How the enclosed parameters form an iterable in this case?
This is called a generator expression. https://www.python.org/dev/peps/pep-0289