State information plays a crucial role in many real-world programs. The state determines the usage of an entity(functions, classes, objects… etc) in a program. Entity-attribute relationship plays a key factor in its usage.
I came across one such issue while trying a solve a real-world program where I wanted the entities to hold the state of the system which I could use later. During this process, I discovered there are multiple ways to do so and I have made an attempt to simplify the same so that it could be helpful for someone out there.
Let’s take a simple problem through which we would understand the retention of states across the program. The problem statement is to implement a program to count the number of times a call has been made to a function based on an initial state given to the function.

#python-programming #coding-style #python3 #design-patterns

Retaining and Passing Information States of Variables in Python
1.05 GEEK