Nptel The Joy Of Computing Using Python | NPTEL Week 6 Quiz Assignment | NPTEL Assignment Solutions

NPTEL The Joy Of Computing Using Python Week 6 Quiz Assignment | NPTEL Swayam Assignment Answers


the joy of computing using python nptel


MCQs (multiple choice questions) Nptel Week 6 Quiz Answers:


Q.1: In the list L = [4,6,7,4,6,2,1], What is the index of element ‘7’? Options are:

(a) 0
(b) 1
(c) 2
(d) 3

Answer is (c) 2


Q.2: Which of the following is true about recursion? Options are:

(a) Recursion always performs better than non-recursive code.
(b) Recursive code is easier to debug
(c) The base case is necessary for recursion.
(d) Recursive code can be shorter than non-recursive code.

Answer is (b) Recursive code is easier to debug
                  (c) The base case is necessary for recursion.
                  (d) Recursive code can be shorter than non-recursive code.


Q.3: What will be the output of the following program? Options are:

what will be the output of the following program?


(a) No output
(b) braKa
(c) Abra
(d) rak

Answer is (b) braKa


Q.4: What will be the output of the following program? Options are:

what will be the output of the following program?


(a) Sum of first 10 natural numbers.
(b) Sum of first 9 natural numbers.
(c) The program will never end.
(d) Sum of numbers from 2-10(Both inclusive).

Answer is (a) Sum of first 10 natural numbers.


Q.5: What's the correct code for Binary search? Options are:

what-the-correct-code-for-Binary-search-1

what-the-correct-code-for-Binary-search-2

what-the-correct-code-for-Binary-search-3
what-the-correct-code-for-Binary-search-4


Answer is (c)



Q.6: Which of the following can be used to see the dimension of a NumPy array named ‘arr’? Options are:

(a) dim(arr)
(b) shape(arr)
(c) arr.shape
(d) arr.shape()

Answer is (c) arr.shape


Q.7: If PYTHON is encoded by TCXLSR then DIAMOND will be encoded as? Options are:

(a) EJBNPOE
(b) FKCORPF
(c) HMERTSH
(d) HMEQSRH

Answer is (d) HMEQSRH


Q.8: Select the correct statement
1) print(‘9a’.isalnum()) will return True.
2) ‘9a’ contains both alphabetic and numeric parts.

(a) Option 1 is correct, option 2 is correct. Option 2 is the correct explanation for option 1.
(b) Option 1 is correct, option 2 is incorrect.
(c) Option 1 is correct, option 2 is correct. Option 2 is not the correct explanation for option 1.
(d) Option 1 is incorrect, option 2 is incorrect.

Answer is (a) Option 1 is correct, option 2 is correct. Option 2 is the correct explanation for option 1.


Q.9: What will be the output of the following program? Options are:

what will be the output of the following program


(a) A dictionary with the count of each character in s.
(b) A dictionary with the count of each special character in s.
(c) A dictionary with the count of letters in s.
(d) Error

Answer is (d) Error


Q.10:Let L be a list containing different names of movies. Which statement is correct to select a random movie name from that list L?

(a) random.choices(L)
(b) random.select(L)
(c) random.movie(L)
(d) random.random(L)

Answer is (a) random.choices(L)


If you are facing any queries regarding this assignment solutions, then please drop comment in comment section.












Post a Comment

0 Comments