Page 46 - IPP-11
P. 46

VIVA VOCE


                1.  What is Python?
               Ans.  Python is an easy-to-learn, general-purpose, dynamic, interpreted, high-level, multi-platform, powerful
                   programming language. It has efficient high-level data structures and a simple but effective approach to
                   object-oriented programming.
                2.  How can you start Python through Windows command prompt?
               Ans.  If you set the Python path for Windows, then you can start Python with the following:
                    C :> python
                3.  What is IDLE?
               Ans.  IDLE (Interactive Development and Learning Environment) is an environment for developing Python
                   programs (“scripts”) under Windows and other operating systems.
                4.  What are the two modes of working in Python?
               Ans.  Python provides two modes of working:
                    (a)  Interactive mode
                    (b)  Script mode
                5.  What is a variable?
               Ans.  A variable is an identifier/placeholder that holds a value. In other words, a variable is a reference to a
                   computer memory location where the value is stored.
                6.  What can a variable hold in Python?
               Ans.  In Python language, a variable can hold a string, a number or several other objects such as a function or
                   a class. Variables can be assigned different values during execution.
                7.  Name the three key attributes of an object in Python.
               Ans.  Each object in Python has three key attributes: a type, a value and an id.
                8.  Define a keyword.
               Ans.  A keyword is a reserved word in the Python programming language. Keywords are used to perform a
                   specific task in a computer program.
                9.  Why is the given statement invalid in Python?
                            x + 1 = x
               Ans.  The statement is invalid because an expression cannot be placed on the left of the equal ‘=’ sign. Therefore,
                   the correct statement should be:
                            x = x + 1
                10.  What is NumPy?
               Ans.  NumPy is a Python extension module that provides efficient operation on arrays of homogeneous data.
                   It allows Python to serve as a high-level language for manipulating numerical data. It is mainly used to
                   apply functions on arrays. Major array functions are handled by NumPy. It is written in C and Python. It
                   supports cross-platform.
                11.  What is a NumPy Array?
               Ans.  A NumPy array is a multidimensional array of objects of the same type. In memory, it is an object
                   which points to a block of memory, keeps track of the type of data stored in that memory, how many
                   dimensions there are, and how large each one is.
                12.  How is NumPy installed?
               Ans.  NumPy is installed by using the pip, a Python package installer as follows:
                       pip install numpy




                                                               1
   41   42   43   44   45   46   47   48   49   50   51