MOST BASIC ONE WORD QUESTION AND OBJECTIVE TYPE QUESTIONS IN PYTHON FOR CLASS 11 AND 12TH

 OBJECTIVE TYPE QUESTIONS AND WORD QUESTIONS 

 1. Fill in the blanks.

(a) ................. is the Python operator responsible for declaring variables. 
(b) The built-in function randrange() belongs to ....................... module
(c) A .................. operator does not directly operate on data but produces a left-to-right evaluation of expression. 
(d) median() method belongs to ................. module in Python. 
(e) The reserved words in Python are called ............... and these cannot be used as names or identifiers.
 (f) An ................. is a symbol used to perform an action on some value.
 (g) A file that contains a collection of related functions and other definitions is called ................. .
 (h) The modules in Python have the ................. extension. 
(i) A ................. is just a module that contains some useful definitions. 
(j) Each object in Python has three key attributes—a ................., a ............. and an ................. . 
(k) In Python, the non-zero value is treated as ................. and zero value is treated as ................. . 
(l) Keys of a dictionary must be .......................... .
 (m) In ....................., the adjoining values in a sequence are compared and exchanged repeatedly until the entire array is sorted. 
(n) Logical operators are used to combine two or more ........... expressions
(o) The ............. function returns the length of a specified list. 

ANSWERS
 (a) Assignment (=) operator 
(b) random   
(c) comma (,)   
(d) statistics   
(e) keywords   
(f) operator  
 (g) module   
(h) .py   
(i) library   
(j) type, value, id  
 (k) true, false   
(l) unique

 2. Multiple Choice Questions (MCQs)
 (a) Which of the following is not considered a valid identifier in Python? 
   (i) two2 (ii) _main (iii) hello_rsp1 (iv) 2 hundred
 
(b) What will be the output of the following code— print(“100+200”)?
     (i) 300 (ii) 100200 (iii) 100+200 (iv) 200

(c) Which amongst the following is a mutable datatype in Python?
 (i) int (ii) string (iii) tuple (iv) list 

(d) pow() function belongs to which library?
 (i) math (ii) string (iii) random (iv) maths

 (e) Which of the following statements converts a tuple into a list?
 (i) len(string) (ii) list(string) (iii) tup(list) (iv) dict(string)

 (f) The statement: bval = str1 > str2 shall return ............... as the output if two strings str1 and str2 contains “Delhi” and “New Delhi”.
 (i) True (ii) Delhi (iii) New Delhi (iv) False 

(g) What will be the output generated by the following snippet?  a = [5,10,15,20,25]  k = 1  i = a[1] + 1  j = a[2] + 1  m = a[k+1]  print(i,j,m)
 (i) 11 15 16 (ii) 11 16 15 (iii) 11 15 15 (iv) 16 11 15 

(h) The process of arranging the array elements in a specified order is termed as:
 (i) Indexing (ii) Slicing (iii) Sorting (iv) Traversing 

(i) Which of the following Python functions is used to iterate over a sequence of numbers by specifying a numeric end value within its parameters?
 (i) range() (ii) len() (iii) substring() (iv) random() 

(j) What is the output of the following?  d = {0: 'a', 1: 'b', 2: 'c'}  for i in d:   print(i)
 (i) 0 (ii) a (iii) 0 (iv) 2  1  b  a  a  2  c  1  2      b  b      2  2      c  c

 (k) What is the output of the following?  x = 123  for i in x:   print(i)
(i) 1 2 3 (ii) 123 (iii) error (iv) infinite loop

 (l) Which arithmetic operators cannot be used with strings?
 (i) + (ii) * (iii) – (iv) All of the above 

(m) What will be the output when the following code is executed?  >>>str1="helloworld"  >>>str1[:–1] (i) dlrowolleh (ii) hello (iii) world (iv) helloworld 

(n) What is the output of the following statement?  print("xyyzxyzxzxyy".count('yy', 1))
 (i) 2 (ii) 0 (iii) 1 (iv) Error

(o) Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is: 
(i) [0, 1, 2, 3]   (ii) [0, 1, 2, 3, 4] (iii) [0.0, 0.5, 1.0, 1.5]   (iv) [0.0, 0.5, 1.0, 1.5, 2.0] 

(p) Which is the correct form of declaration of dictionary?
 (i) Day={1:’monday’,2:’tuesday’,3:’wednesday’} (ii) Day=(1;’monday’,2;’tuesday’,3;’wednesday’) (iii) Day=[1:’monday’,2:’tuesday’,3:’wednesday’] (iv) Day={1’monday’,2’tuesday’,3’wednesday’] 

(q) Identify the valid declaration of L: L = [1, 23, ‘hi’, 6] 
(i) list (ii) dictionary (iii) array (iv) tuple  

Answers: (a) (iv) 
(b) (iii)          (c) (iv)         (d) (i)          (e) (ii)         (f) (iv)       (g) (ii)        (h) (iii)              (i) (i)    (j) (i) (k) (iii)          (l) (iii)          (m) (i)         (n) (i)          (o) (iii)      (p) (i)         (q) (i)



Similar post:

Post a Comment

0 Comments