Example Analysis of functional programming in python
This article is about the sample analysis of functional programming in python. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Its core is function. Computer operation is regarded as the calculation of function in mathematics, which avoids the concept of state and variable.
2. Functional programming is a highly abstract programming paradigm, and functions written in pure functional programming languages have no variables.
So any function, as long as the input is definite and the output is definite, we call it a pure function with no side effects. And allow the use of variables in the programming language, because the state of variables within the function is uncertain, the same input, may get different output, so this function has side effects.
Example
# here put the import lib# 's purest functional programming def cal (x, y): return x + y # while functions under python are usually blocks of code organized together to implement specific functions. Thank you for reading! This is the end of this article on "sample Analysis of functional programming in python". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!