I though i could contribute, use a line breaker:
x = lambda x,y: x-y if x<y \
else y-x if y<x \
else 0
Don't forget the very nice thing that python is able to write oneliners , as in example:
a=b=0; c=b+a; d = a+b**2 #etc etc
And the lambda is very powerful, but it is not meant for substitution of 1 whole function, i mean you could hack it like (borrowing example from colleague above) :
makeTag = lambda tagName: "<{}>".format(tagName)
closeTag = lambda tagName: makeTag("/"+str(tagName))
openTag = lambda tagName: makeTag(tagName)
writeHMTLline = lambda tag,content: ""+opetTag(tag)+str(content)+closeTag(tag)
But do you really want to do it like this ? It is mostly unreadable after some time, it is like getting to the beginning of the rope starting with unraveled end.

Lambdas are ment as one-only functions, in map,filter and reduce functions in Functional Oriented Programing ( among other things ). For example geting character values of values that are integers and divisible by 2
chrDev2 = lambda INT: chr(INT) if isinstance(INT,int) and INT%2==0 else INT
someStringList = map( chrDev2, range(30) )
>>> ['\x00', 1, '\x02', 3, '\x04', 5, '\x06', 7, '\x08', 9, '\n', 11, '\x0c', 13, '\x0e', 15, '\x10', 17, '\x12', 19, '\x14', 21, '\x16', 23, '\x18', 25, '\x1a', 27, '\x1c', 29]
You could use it as function expresions function by deifning complex function ( or more and several lambdas , and putting it inside another lambda:
def someAnon(*args): return sum(list(args))
defAnon = lambda list: [ x*someAnon(*list) for x in list]
but Python has function expresions support in another way:
-lets say you have some function called superAwesomeFunction
and that function can do some super awesome stuff, you can assign it to a variable by not calling it, like this:
SAF = superAwesomeFunction # there is no () at the end,
So now when you call SAF you will call superAwesomeFunction or method. If you search trough your Lib folder you can find that most of python __builtin__
modules are written that way. This is done because sometimes you will need some functions that do specific task that is not necessary enough to be usable by user but it is necessary for several function. So then you have a choice you can not have 2 functions with name "superAwesomeFunction" , you can have "superAwesomeFunctionDoingBasicStuf" and "realSuperAwesomeFunction" and than just put the "realSuperAwesomeFunction" in "superAwesomeFunction" variable and you are done.
You can find the location of imported modules by entering in console importedModule.__file__
( real example import os;os.__file__
) , and just follow that directory to file called importedModule.py and open it in editor and find how you can maximize your own "knowledge".
I hope this helps you and maybe other colleagues in trouble.
def
? It now has exactly the same visual structure.