Functional Programming (Theory of Python) (Python Tutorial)
Real Physics
in this video I want to introduce to you the concept the paradigm of functional programming and I
want. to show how you can do it in Python so in Python there is of course a. Lambda expression
and there 's fiber there are five or six functions that I need to call out to you that that that. that
that is built into the language that you might want to take advantage of if you want to try the
functional programming approach. A pure function means that every time you call it it does the
same thing it does n't change its behavior. In functional programming functions are a first-class
value and what this means is just like you can pass numbers around you could pass functions
around. Recursion is the only algorithm the only method you can use to solve certain kinds of
computing program computing problems when it comes to trees and functional programming
there 's several optimization. tail recursion is one optimization that it can refused to call
functions if if the result is n't needed. Memorization is often called memoization ME mo i za tion
and it 's a fairly powerful technique it can greatly increase the speed of your program especially
if you 're calling the same functions over and over again with the same arguments. at the same
time if a pure function is called twice you can remember the result and return that instead.
Many of the ideas that you learned from functional program are directly applicable to Python and
languages similar to Python that are n't first class you know functional programming languages
but are similar so if you do study functional programming when you get a chance I do encourage
you to to to dive a little bit deeper in this topic and learn more. It's rather easy to specify pure
functions using the Lambda expression. You must be careful that the expression contains
function calls that are not pure. The next function I want to look at is called map and what map
does is it takes a function and it can take iterables one or more iterables. The func tool modules
has a lot of interesting functions that you might want to look at some of them are a little bit
complicated you might be struggling to find a way to use them one of them is called zip. Zip
takes a series of iterators or iterables and it combines them together again this returns an
iterator.
This is a very brief introduction to functional programming I can only go so far in the time that I
have allocated and I wanted to get you introduced to these functions. I wanted you to get used to
the lambda expression and hopefully to whet your appetite for learning more about functional
programming and lambda calculus. thank you so much have a great day bye bye you
Real Physics
in this video I want to introduce to you the concept the paradigm of functional programming and I
want. to show how you can do it in Python so in Python there is of course a. Lambda expression
and there 's fiber there are five or six functions that I need to call out to you that that that. that
that is built into the language that you might want to take advantage of if you want to try the
functional programming approach. A pure function means that every time you call it it does the
same thing it does n't change its behavior. In functional programming functions are a first-class
value and what this means is just like you can pass numbers around you could pass functions
around. Recursion is the only algorithm the only method you can use to solve certain kinds of
computing program computing problems when it comes to trees and functional programming
there 's several optimization. tail recursion is one optimization that it can refused to call
functions if if the result is n't needed. Memorization is often called memoization ME mo i za tion
and it 's a fairly powerful technique it can greatly increase the speed of your program especially
if you 're calling the same functions over and over again with the same arguments. at the same
time if a pure function is called twice you can remember the result and return that instead.
Many of the ideas that you learned from functional program are directly applicable to Python and
languages similar to Python that are n't first class you know functional programming languages
but are similar so if you do study functional programming when you get a chance I do encourage
you to to to dive a little bit deeper in this topic and learn more. It's rather easy to specify pure
functions using the Lambda expression. You must be careful that the expression contains
function calls that are not pure. The next function I want to look at is called map and what map
does is it takes a function and it can take iterables one or more iterables. The func tool modules
has a lot of interesting functions that you might want to look at some of them are a little bit
complicated you might be struggling to find a way to use them one of them is called zip. Zip
takes a series of iterators or iterables and it combines them together again this returns an
iterator.
This is a very brief introduction to functional programming I can only go so far in the time that I
have allocated and I wanted to get you introduced to these functions. I wanted you to get used to
the lambda expression and hopefully to whet your appetite for learning more about functional
programming and lambda calculus. thank you so much have a great day bye bye you