Home > other >  Is there any way rather than assigning functions to modules?
Is there any way rather than assigning functions to modules?

Time:06-30

I found this definition of modules in Python:

"Structures that contain functions or properties, in which we can declare variables."

Don't we need to assign functions to modules every time, or is there any way rather than assigning functions?

CodePudding user response:

Per the Python docs I think we can update the definition just a little: A module is a file containing Python definitions and statements

So you don't really need to have a function in a module if you don't want :)

Reference: https://docs.python.org/3/tutorial/modules.html

  • Related