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

for i in range(fromVal, to + 1):
                        print(values[i],  end = '*')
                    Which of the following lines of output will never be produced on execution of the above code?
                    a.  50*70*               b. 30*50*70*           c. 30*50*70*90*       d. 50*70*90*110*
                 3.  Consider  the  following  statements  and  select  the  output  that  will  be  produced  on  the  execution  of  the  following
                    code:
                    >>> dict1 = {1:'one',  2:'two',  3:'three',  4:'four'}
                    >>> len(dict1.keys())
                    a.  8                    b. 15                  c. 4                  d. 19

                 4.  Consider the program given below:
                    import random
                    picker = random.randint(0,  3)
                    color = ['BLUE',  'PINK',  'GREEN',  'RED']
                    for i in color:
                      for j in range(1,  picker):
                            print(i,  end='')
                      print()
                    Which of the following lines of output will be produced on execution of the above code?

                    a.  BLUE                                        b. BLUE
                      GREEN                                           BLUEPINK
                      PINK                                            BLUEPINKGREEN
                      RED
                    c.  PINK                                        d. BLUEBLUE
                      PINKGREEN                                       PINKPINK
                      GREENRED                                        GREENGREEN
                                                                       REDRED
                 5.  Which of the following is NOT a function of statistics module?
                    a.  mean()               b. median()            c. floor()            d. mode()
                 6.  Which of the following is True about trigonometric functions in Python?
                    a.  They are defined in trigonometry module.
                    b.  cos() takes a positive integer or floating point number in radians as an input.
                    c.  sin() takes a positive integer or floating point number in degrees as an input.
                    d.  tan() returns the arc tan value in degrees.
                 7.  Which of the following is false about functions defined in random module?
                    a.  random() enables us to generate a random number between 0 and 1.
                    b.  randint(p, q) generates random numbers between p and q, both inclusive.
                    c.  randrange(p, q) generates random numbers between p and q, both exclusive.
                    d.  randrange(p, q) generates random numbers between p and q, only q exclusive.
                 8.  Which of the following functions from statistics module will return the most frequently occurring value in a list?
                    a.  mean()               b. mode()              c. median()           d. frequent()
                 9.  Which of the following function header is correctly defined?
                    a.  def test(a=10, b=20, c):
                    b.  def test(a=10, b, c=30):
                    c.  def test(a, b=20):
                    d.  def test(a=30, b, c):

               248   Touchpad Computer Science (Ver. 2.0)-XI
   257   258   259   260   261   262   263   264   265   266   267