Is there a simpler way to modify all arguments in a function before using the arguments?

bruceg113355 at gmail.com bruceg113355 at gmail.com
Fri Nov 9 19:48:02 EST 2012


Is there a simpler way to modify all arguments in a function before using the arguments?

For example, can the below code, in the modify arguments section be made into a few statements?  

    def someComputation (aa, bb, cc, dd, ee, ff, gg, hh):
       # modify arguments
       # ----------------------
        aa = aa.replace (“_” , “”)
        bb=  bb.replace (“_” , “”)
        cc = cc.replace (“_” , “”)
        dd = dd.replace (“_” , “”)
        ee = ee.replace (“_” , “”)
        ff = ff.replace (“_” , “”)
        gg = gg.replace (“_” , “”) 
        hh = hh.replace (“_” , “”)

       # use the arguments
       # -----------------
       # …




More information about the Python-list mailing list