short lambda example

This commit is contained in:
rasbt 2014-08-19 09:57:13 -04:00
parent d07be79be8
commit bdd74ca15c

View File

@ -0,0 +1,11 @@
# Sebastian Raschka 08/2014
# Lambda functions are just a short-hand way or writing
# short function definitions
def square_root1(x):
return x**0.5
square_root2 = lambda x: x**0.5
assert(square_root1(9) == square_root2(9))