Professional Documents
Culture Documents
Class Notes Day 2
Class Notes Day 2
-----------------------------
are anonomous functions - they dont hvae any names
they are used to achieve small tasks
we cannot have control flow statements like if else while etc in lambda functions
they are single line functions
return type of a lambda function is a function
they are faster than traditional functions
return type of a lambda function is a function
syntax
function_name = lambda input arguments : return value
map - takes one by one each input and pass it to a function to process
- number of inputs is same as number o/ps
- in ver 2.x of python map returns a list
- in ver 3.x map returns an object we need to type cast to list
synatx
fg job id
sh 1238
homework-