I'm relatively new to python, and in my learning venture, I've seen a lot of this in my learning venture:
list_name.sort(key=…, reverse=…)
I don't quite understand why, in some functions, they create a variable within the function, rather than simply entering the number, Boolean, string, etc.
I have a working theory on why this is done, but I'd like some reassurance on this.
My assumption is that declaring the variable within the function call has no effect on the execution of the call. Effectively, it is the same as simply entering the value into the call, but provides better clarity on the use of the function.
I believe my understanding is correct, but I haven't seen it written anywhere and I'd love some reassurance.