I think that one could argue that the function programming construct is probably one of the most important concepts in coding. The concept of a function is an abstraction allowing a user to be able to simply know what the function does and the inputs required to generate an output. This allows a small bit of the code block that houses the function to serve as an automatic processor of data that goes into it that is reusable with all inputs that match the required data types of the inputs. Functions can be built to filter input data, perform data transformations, prepare and display plots and visualizations. In essence, the function capability allows code to be modularized into smaller pieces of code that do a particular task and combined with other functions to perform more complex tasks. The utility of functions is limitless, but without knowing how to conceptually design, build, and document a function, it can easily become an exhaustive task.

The basic concept of how a function is pretty straightforward, but understanding how to develop a good quality workflow for a function is what makes it clean, simple, and easy to read and understand. I’ll highlight the basics of building a function, concepts to developing good functions, and how to properly document your function with docstrings.

#data-science #coding #learning #python #programming

Python Beginner Breakthroughs (Functions)
2.05 GEEK