Hi,

I am trying to set the return value from a function to a name which I
grab from the for loop. I can't work out how I can do this without
using an if statement...

for f in var1_fn, var2_fn, var3_fn:
    if f.split('.')[0] == 'var1':
        var1 = call_some_function(f)
        .
        .
        .
      etc

 Really I would like to remove the need for this if loop and I am sure
there is a simple way I am missing?

Many thanks

Martin

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to