To expand on the above, Python does not have statements in its lambda forms, but that does not stop pythoneers from getting the job done.
I use a named function for that, but if you have an issue with that, it really is worth following Terry's advice as the subject has been tackled at great length before. - Cheers, Paddy. -- http://mail.python.org/mailman/listinfo/python-list