In python 2.6, I want to do:
f = lambda x: if x==2 print x else raise Exception() f(2) #should print \"2\" f(3) #should throw an exception <
Hope this will help a little
you can resolve this problem in the following way
f = lambda x: x==2 if f(3): print("do logic") else: print("another logic")