Feb-08-2020, 03:50 AM
(Feb-08-2020, 02:54 AM)Larz60+ Wrote: globals are almost never necessary.
If you feel you need them, rethink your coding
def bind_a_variable(): alist = [] return alist a = bind_a_variable()of course in reality, you would code this simply as:
a = []
Thanks. In regard to globals are almost never necessary, is it the same reason as other languages such as C and C++?
Anyway, I am trying to understand some examples from teaching materials.