I’ve written a small script in Python for simple text manipulation, consisting of a bunch of functions. Some of these functions contain magic numbers or string constants. Is it okay to store them in global variables? I do not intent to modify them, they are more like constants.
I’ve written a small script in Python for simple text manipulation, consisting of a
Share
Yes, it’s legimitate use. You will encounter that in many good Python codes. Just note that the convention is to write the names of such “constants” in
UPPER_CASE.