DevPlayer <devpla...@gmail.com> writes:

> def maketup(lst):
>
>     if len(lst) == 1:
>         return lst[0]
>
>     elif len(lst) == 2:
>         return (lst[0],lst[1])
>
>     elif len(lst) > 2:
>         return ( (maketup(lst[:-2]), lst[-2]), lst[-1])

The OP wants all binary trees over the elements, not just one.

-- Alain.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to