yes, it would indeed be better to return values from a function. it's ok to print things in a function -- you can use the DEBUG (or even add another VERBOSE flag) flag to turn those on or off.
but yeah, a function that does a consistent thing with its inputs and outputs are called deterministic or pure and they're considered good style. a "bad" function would be one that uses many, or only global variables to "decide" what it's going to do
yes, it would indeed be better to return values from a function. it's ok to print things in a function -- you can use the DEBUG (or even add another VERBOSE flag) flag to turn those on or off.
but yeah, a function that does a consistent thing with its inputs and outputs are called deterministic or pure and they're considered good style. a "bad" function would be one that uses many, or only global variables to "decide" what it's going to do
https://github.com/vezinaca/Banq_Achat/blob/11f3a9cbee370c9c3c03fa3372e57164e619ddc3/scrape_catalogue.py#L63