diff --git a/howtos_as_py_files/lambda_function.py b/howtos_as_py_files/lambda_function.py new file mode 100644 index 0000000..9da0c9c --- /dev/null +++ b/howtos_as_py_files/lambda_function.py @@ -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)) \ No newline at end of file