Without functions all we have are attributes of objects. Functions are where variables live. This extract from Programmer's Python: Everything is an Object explains that functions bring something new ...
It is obvious that global variable are always shared and in most cases this isn’t a problem. However, suppose you have some existing code that makes use of a global variable to store its state and we ...