Help with AI search script

Frank Buss fb at
Wed Aug 28 04:40:48 CEST 2002

denimboy at (Dennis Watson) wrote:

> def depth_first (start, goal_p, successors):
>     """Search new states first until goal is reached"""
>     return tree_search ( [start], goal_p, successors, lambda (new,
> old): (new.extend(old)) )

You MUST write:

lambda new, old: (new.extend(old))

And you CAN omit the other parantheses:

lambda new, old: new.extend(old)

For all lambda expressions in your code.

Frank Buss, fb at,

[ is moderated.  To submit, just post and be patient, or if ]
[ that fails mail your article to <comp-ai at>, and ]
[ ask your news administrator to fix the problems with your system. ]

More information about the Python-list mailing list