Functional Programming
Functional Programming
Functional programming is more about declaring what you want to happen, rather than how you want it to happen. Imperative (or procedural) programming declares both the what and the how.
In FP, we strive to make data immutable. Once a value is created, it cannot be changed. Mutable data, on the other hand, can be changed after it's created.
For Python: - Tuples and lists are both ordered collections of values, but tuples are immutable and lists are mutable. - You can append to a list, but you can not append to a tuple. You can create a new copy of a tuple using values from an existing tuple, but you can't change the existing tuple.