What are python modules?

Home Forums Python Course Forum Python Basics What are python modules?

Viewing 1 reply thread
  • Author
    Posts
    • sravani.h2kinfosys
      Participant
      (49.207.203.34)

      #19661

    • nehatimothy1612
      Participant
      (182.75.121.182)

      A Python module is a file containing Python definitions and statements. A module can define functions, classes, and variables. A module can also include runnable code. Grouping related code into a module makes the code easier to understand and use. It also makes the code logically organized.When the interpreter encounters an import statement, it imports the module if the module is present in the search path. A search path is a list of directories that the interpreter searches for importing a module. For example, to import the module calc.py, we need to put the following command at the top of the script.

      #23573

Viewing 1 reply thread
  • You must be logged in to reply to this topic.