-
Notifications
You must be signed in to change notification settings - Fork 3
Functional Programming
surendrabisht edited this page Jul 16, 2020
·
1 revision
Functional programming is a style of programming that (as the name suggests) is based around functions.
A key part of functional programming is higher-order functions. We have seen this idea briefly in the previous lesson on functions as objects.
Higher-order functions take other functions as arguments, or return them as results.
Functional programming seeks to use pure functions.
Pure functions have no side effects, and return a value that depends only on their arguments.
Pure function is a function which:
- Given the same inputs, always returns the same output, and
- Has no side-effects
- easier to reason about and test.
- more efficient. Once the function has been evaluated for an input, the result can be stored and referred to the next time the function of that input is needed, reducing the number of times the function is called. This is called memoization.
- easier to run in parallel.
Keep Learning. Never Settle! 😊
- Home
- 1.Introduction To Python
- 2. DataTypes
- 3. Strings and Slicing of collection
- 4.If else & Loops
- 5. Break, continue, pass
- 6. Functions
- 7. Modules
- 8. Clarifying basics
- 9. File Handling
- 10. Exception Handling
- 11. Dig into Collections
- 12. Iterators, Generators and list comprehension
- 13. lambdas , map, filter and other concepts
- 14. args, kwargs an default parameters
- 15. Functional Programming
- 16. OOPs