Page 365 - Information_Practice_Fliipbook_Class11
P. 365

34.  What will be the output produced on execution of the following code?

                  >>> name = "Computer Science with Python"
                 >>> print(name[9:17])
             Ans.  Science
              35.  What are the built-in types that Python provides?

             Ans.  Python provides built-in types of two types: mutable and immutable. Mutable types:
                  • List
                  • Sets
                  • Dictionaries
                  Immutable built-in types:
                  • Strings
                  • Tuples
                  • Numbers
              36.  Evaluate the following expressions:
                  a.  6 * 3 + 4**2 // 5 – 8
                  b.  10 > 5 and 7 > 12 or not 18 > 3
             Ans.  a.  13

                  b.  False
              37.  What do you understand by the term iteration?

             Ans.  Repetition of statement/s finite number of times is known as iteration.
              38.  What is the use of // operator in Python?

             Ans.  It is a divide and truncate the quotient operator; for example,  15//4 -->3, 15//4.0 -->
                  3.0, 15.0//4.0 --> 3.0. Note that if one (both) of the operands is (are) floating point numbers, it yields a floating
                  point number.
              39.  What are literals in Python?

             Ans.  A literal is a fixed value, examples include string literals, numeric literals, and boolean literals.
              40.  What is a Dictionary in Python?
             Ans.  Dictionary is an important built-in data type in Python. It defines one-to-one relationship between keys and
                  values. Dictionaries contain a pair of keys and their corresponding values.
                  Dictionaries are indexed by keys.
              41.  How will you reverse a list?

             Ans.  list.reverse() − Reverses items of list in place.
              42.  Differentiate between a candidate key and a primary key for a relation in SQL.
             Ans.  A candidate key is any column or combination of columns that could be used as a primary key, whereas a primary
                  key is the chosen candidate key that uniquely identifies rows and enforces entity integrity in the table.

              43.  What is meant by a NULL value? What are the reasons that lead to their occurrence in database relations?
             Ans.  The absence of a data item is represented by a special value called the null value. There are three situations
                  which may require the use of null values
                  i.  When a particular attribute does not apply to an entity,
                  ii.  Value of an attribute is unknown, although it exists;
                  iii.  When the value is unknown because it does not exist


                                                                                            Viva Voce Questions  351
   360   361   362   363   364   365   366   367   368   369   370