A Lambda is an anonymous function. Places like AWS have services set up entirely just to host these simple functions that don't require a ton of code or backend. To run the Python here, I go back to Google Colaboratory; Check out my Lambda book here Ex. 1 g = lambda x: 3 *x + 2 g( 3 ) Simple. Ex. 2 full_name = lambda fn, ln: fn.strip().title() + " " + ln.strip().title() full_name( " Ember" , "Serros" ) Notice the spaces in front of the first name (' Ember') Ex. 3 def func ( x , y ): """Does things""" func2 = lambda x: x + y+ 3 print (func( 2 , 7 )) Using def seems to be hit or miss. This returns None, which technically is correct, but I'm expecting a number (12). It's missing a return statement; ...
I research and implement products + infrastructure for the Cloud, software, and other interesting things. My tailored Cloud Project Portfolio is at runtcpip.com