Page 185 - Robotics and AI class 10
P. 185

Chapter 4




                                                    iNtRoDuctioN to DAtA AND


                                                   pRogRAmmiNg with pythoN












                             Learning Outcomes




                •  Modules and Packages                                 •  Lists in Python
                •  Tuples in Python                                     •  Difference between List and Tuple
                •  Some More Programs                                   •  Strings



                    Modules and Packages


            A module is a python file containing a collection of Python statements, functions and global variables. It is created
            with an extension .py. A collection of relevant modules saved under the same directory and a name is called a
            Package. There are various packages related to various purposes available for free to be used in Python.

            Scope and Uses of Packages
            Since a package organizes related modules, sub-packages, and resources into a hierarchical structure it provides a
            large set of predefined functions, classes, and methods for various tasks.
            The scope of the packages lies in:

            Organizing code: It organises the related modules into a hierarchical structure, making it more manageable and
            easier to navigate.

            Code reusabiltiy: Since the code is created once and can be used by anybody. Thus it provides the feature of
            reuseability of the code and eliminating the changes of duplicating code.
            Distribution and installation: Packages allow you to distribute and install code as a unit. You can package your
            code and resources into a distributable package format like .tar.gz file. This makes it easier to share your code with
            others or deploy it on different systems.

                                                                                       #Coding & Computational Thinking
                        Video Session

                  Scan the QR code or visit the following link to watch the video:

                  Modules in Python Explained | Python Built in Modules | Python Tutorial for Beginners
                  https://www.youtube.com/watch?v=1oFneicTaII





                                                         Introduction to Data and Programming with Python  183
   180   181   182   183   184   185   186   187   188   189   190