Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

lambda function if else in python

# Lambda function with if-else
square = lambda x : x*x if(x > 0) else None
 
print(square(4))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #lambda #function #python
ADD COMMENT
Topic
Name
2+9 =