Python is a programming language for data science projects. Here functions play a top role. Since re-usable code, you can put in one function, and you can call as many times as you need. In functions, the below example gives you an idea on Pass by value and reference.
In functions, two concepts, you can read. Once is Pass by value and the other one is Pass by reference. Value and reference both you need to understand as Value – Literal and Reference – Address.
Pass by value and pass by reference in Python
Pass by Value
The output shows, the same values as defined in inside of function are displayed. It is not modified.
#This function updates the passed values
Pass by reference
The output is modified. This is different from as defined in function. This is due to in-built append function.
# This program demonstrates the concept of call by reference