[Tutor] Example 1

Adam Vardy Adam Vardy <anvardy@roadrunner.nf.net>
Tue Dec 10 20:53:01 2002


I can follow the meaning of the following function. Should be simple,
so, want to explain?

def union(*args):
    res = []
    for seq in args:                     # for all args
        for x in seq:                    # for all nodes
            if not x in res:
                res.append(x)            # add new items to result
    return res
  

-- 
Adam Vardy