Page 535 - Computer Science V2.0 Class 11
P. 535

11.  Which python function is used to yield the type of an object?
                  Ans.  In Python, you can use the type() function to determine the type of an object. The type() function takes an
                      object as an argument and returns the type of that object.
                   12.  How can we convert a string to an integer in Python?
                  Ans.  Using int() method. For example, int('123') yields 123.
                   13.  What is the purpose of using a flowchart.
                  Ans.  Flowchart provides a unique feature of breaking down of a complex problem into parts in order to obtain the
                      solution to a given problem.
                   14.  Is Python an object-oriented programming language?
                  Ans.  Yes, Python is an Object-oriented Programming language.
                   15.  How many else clauses can be added in a try...except block?
                  Ans.  Only one.

                   16.  What is an I-P-O cycle?
                  Ans.  IPO cycle ("Input > Process > Output" cycle) represents the sequential stages through which data or actions
                      flow in a system where initial data (input) is transformed (process) to produce a result (output), which can then
                      influence subsequent actions (input).

                   17.  What is the difference between RAM and ROM?
                  Ans.  RAM refers to random access memory where both read and write operations can take place. But RAM is a
                      volatile memory; its contents are lost when power is turned off. ROM refers to read-only memory where only
                      read operation can take place. ROM is a non-volatile memory.
                      Both RAM and ROM are parts of the primary memory.
                   18.  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 identifier.

                   19.  What is the difference between a keyword and an identifier?
                  Ans.  Every language has keywords and identifiers, which are only understood by its  compiler. Keywords are predefined
                      reserved words which possess special meaning. An identifier is a unique name given to a particular variable,
                      function or label of class in a program.

                   20.  What is the difference between an expression and a statement in Python?
                  Ans.  S.No.                 Expression                                     Statement

                                An expression is a combination of symbols,  A statement is defined as any programming instruction
                        1
                                operators and operands.                  given in Python as per the syntax.
                        2       An expression represents some value.     A statement is given to execute a task.
                                The  outcome  of  an  expression  is  always  a  A statement may or may not return a value as the result.
                        3
                                value, for example, 3*7 + 10 is an expression.  print(“Hello”)  is a statement.

                   21.  What are mutable data types in Python?
                  Ans.  Mutable data types in Python are data types that can be modified after creation. Some common examples of
                      mutable data types in Python include lists, dictionaries, and sets.
                   22.  What is the default value of end parameter in print() function?
                  Ans.  By default, the value of this parameter is '\n', i.e. the new line character.

                   23.  What is the pupose of a break statement?
                  Ans.  The break statement in Python is used to exit from a loop prematurely. It is typically used within loops (such as
                      for or while loops) to immediately terminate the loop's execution, even if the loop's condition or iteration hasn't
                      naturally completed.

                                                                                                 Viva Voce Questions  521
   530   531   532   533   534   535   536   537   538   539   540