def find_supply(suppliers,parts,sno,pno): #1 check if sno is present in suppliers found_s, pos_s = suppliers.find(sno) if not found_s: return (False,None,....) else: #2 check is pno is present in parts found_p, pos_p = parts.find(pno) if not found_p: return (False,None,....) else: #3 check if sno-pno is present in "supply" # check in supply list originating from supplier node (pos_s.get_next().get_first_supply()) ... use snext return (True,sp,) return (False,sp,) # check in supply list originating from part node (pos_p.get_next().get_first_supply()) ... use pnext return (True,sp,....) return (False,sp,.....) #return (True,sp,ps,found_s,pos_s,found_p,pos_p) #return (False,sp,ps,found_s,pos_s,found_p,pos_p)