What I learnt Today
1.Return statements and Lambda functions.
On what I learnt today
a) Return statements
In return statements i was learning what they are and how they differenciate from print statements.
When we include a return statement in a function we can store the result of that value and reuse it.
In a print statement when the function is executed it can't be reused.
B) Lambda Functions
A lambda function is a quick and throw-away function.
Used when we want to perform a certain operation and forget about it.
Example :
add = lambda x , y : x + y
print(add(2,5))
X and y are the parameters
x + y is the execution.
Then print the output.
Resources I used
1.Python refresher series by Bonaventure Ogeto
2.Github for documenting the python series journey by pushing to public repo python-concepts
What's Next
Learn how to write clean and modular code
Top comments (0)