conditionals in lambdas?

Michael P. Soulier msoulier at nortelnetworks.com
Fri Nov 3 14:39:07 EST 2000


    Hey people. If I want to put conditions in a lambda function, how would I
go about that? 

def test(string):
    if string[:3] == 'yes:
        return 1
    else:
        return 0

    I'd like to make something like this a lambda function. Is that possible?

    Mike

-- 
Michael P. Soulier, TD12, SKY  Tel: 613-765-4699 (ESN: 39-54699)
Optical Networks, Nortel Networks, SDE Pegasus
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to UNIX
Nortel Linux User's Group Ottawa: (internal) http://nlug.ca.nortel.com



More information about the Python-list mailing list