What is the purpose of a module in Python?
A. To define classes
B. To create graphical interfaces
C. To organize functions, classes, and variables
D. To execute code line by line
Answer: Option C
Solution (By Examveda Team)
In Python, the purpose of a module is to organize functions, classes, and variables.A module in Python is a file containing Python definitions and statements. The primary purpose of modules is to organize related code into reusable units. Modules can contain functions, classes, variables, and even other modules. By structuring code into modules, you can break down large programs into smaller, more manageable pieces, making it easier to understand, maintain, and reuse. Additionally, modules facilitate code sharing and collaboration among developers by providing a standardized way to encapsulate and distribute functionality.
Join The Discussion