How to iterate a function untill last argument with any order of input?

HI

I need to get the function "kick" to get executed in any way the parameters are passed in to the function. The parameters are first stored in a dictionary

        self.otherlist = {}
        print self.otherlist
        self.populateTestList(self.system_type)
        print "########################################################"
        for machine, market in self.otherlist.items():
            print [(v if isinstance(v, basestring) else v.keys()[0]) for v in market]
        print "########################################################"

1) I am passing arguments i) vegetables ii) fruits to the function kick

    def kick(self,system,market):
        if isinstance(market, dict):
            for key, val in market.items():

                if re.search('fruits', key, re.M|re.I):
                    fus = ""
                    for count, fus_area in enumerate(val.get('Fus_Area')):
                        if count == 0:
                            fus = fus_area.lower()
                        else:
                            fus = fus + "," + fus_area.lower()

                    cmd = "python %ssetup.py %s %s %s" % \
                        (cur_path, host, fus, self.build)
                    rc = self.exec_proc(cmd)

                elif re.search("flowers",market, re.M|re.I):
                    cmd = "python %sdump1.sh %s %s %s" % \
                        (cur_path, host, system, self.build)
                    rc = self.exec_proc(cmd)

        else:
            if re.search("vegetable",market):

                       cmd = "python %sguestlist.py \
                        %s --log-number " % \
                        (self.jid)
                    rc = self.exec_proc(cmd)

                else:
                    cmd = "piral Config \
                    %s" % \(system)
                    rc = self.exec_proc(cmd)

self.kick(system,market)

The output expected is as follows:

When I pass first argument "vegetable" second argument "fruit" the loop flows to "else" condition and gets executed only for second argument "fruit" then it should pass to first argument and get "vegetable" parameter also executed.

But here with this code when I pass first argument "vegetable" second argument "fruit" the loop flows to "else" condition and gets executed only for second argument "fruit" and the flow ends.

Please help to get all arguments getting executed with any order (vegetable, fruit) or (fruit, vegetable) provided as input.

Thanks in advance
:confused:

What shell is this? I don't recognise it. It looks more like C to me. If it is, we can move it to a more suitable forum.

Thanks, in advance,
Robin