Embed presentation






![IMPORT AS STATEMENT [RENAMING A MODULE] Python provides us the flexibility to import some module with a specific name so that we can use thisname to use that module in python source file. Syntax:import <module-name> as <specific-name> Example:import calculation as cal;a = int(input(“Enter first number”))b = int(input(“Enter second number”))print(“Sum = “, cal.sum(a,b))](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f5modulesinpython-210827063229%2f75%2fModules-in-Python-Programming-7-2048.jpg&f=jpg&w=240)




The document explains Python modules, which are program files that encapsulate functions, classes, or variables, enabling logical code organization. It describes how to import modules using import and from-import statements and how to use the import as feature to rename modules. Additionally, it covers the dir() and reload() functions for managing modules and introduces Python packages for organizing code in a hierarchical structure.






![IMPORT AS STATEMENT [RENAMING A MODULE] Python provides us the flexibility to import some module with a specific name so that we can use thisname to use that module in python source file. Syntax:import <module-name> as <specific-name> Example:import calculation as cal;a = int(input(“Enter first number”))b = int(input(“Enter second number”))print(“Sum = “, cal.sum(a,b))](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f5modulesinpython-210827063229%2f75%2fModules-in-Python-Programming-7-2048.jpg&f=jpg&w=240)




Introduction to Python modules, defining a module, contents (functions, classes, variables), and how to save code in a .py file.
Methods of loading modules using 'import' and 'from-import'. Examples include importing entire modules or specific functions.
Functions like dir() to list module content and reload() to refresh loaded modules.
Overview of Python packages, their structure, and an example of a library management system with sub-packages.