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

bruceg113355 at gmail.com bruceg113355 at gmail.com
Sat Nov 10 01:48:02 CET 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