M3-R5 Python MCQ Questions and Answers

M3-R5 Python MCQ Questions and Answers

301.Suppose list1 is [1, 3, 2], What is list1 * 2?
मान लीजिए कि list1 [1, 3, 2] है, list1 * 2 क्या है?
A) [2, 6, 4]
B) [1, 3, 2, 1, 3]
C) [1, 3, 2, 1, 3, 2] ✔️
D) [1, 3, 2, 3, 2, 1]

302.Suppose list1 = [0.5 * x for x in range(0, 4)],list1 is:
मान लीजिए कि सूची 1 (x (0, 4)] में x के लिए [0.5 * x], सूची 1 है:
A) [0, 1, 2, 3]
B) [0, 1, 2, 3, 4]
C) [0.0, 0.5, 1.0, 1.5] ✔️
D) [0.0, 0.5, 1.0, 1.5, 2.0]

303.To add a new element to a list we use which command?
एक सूची में एक नया तत्व जोड़ने के लिए हम किस कमांड का उपयोग करते हैं?
A) list1.add(5)
B) list1.append(5) ✔️
C) list1.addLast(5)
D) list1.addEnd(5)

304.To insert 5 to the third position in list1, we use which command?
सूची 1 में 5 से तीसरे स्थान पर डालने के लिए, हम किस कमांड का उपयोग करते हैं?
A) list1.insert(3, 5)
B) list1.insert(2, 5) ✔️
C) list1.add(3, 5)
D) list1.append(3, 5)

305.To remove string “hello” from list1, we use which command?
सूची 1 से स्ट्रिंग “हैलो” को हटाने के लिए, हम किस कमांड का उपयोग करते हैं?
A) list1.remove(“hello”) ✔️
B) list1.remove(hello)
C) list1.removeAll(“hello”)
D) list1.removeOne(“hello”)

306.Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?
मान लीजिए कि list1 [3, 4, 5, 20, 5] है, list1.index (5) क्या है?
A) 0
B) 1
C) 4
D) 2 ✔️

307.Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)?
मान लीजिए कि सूची 1 है [3, 4, 5, 20, 5, 25, 1, 3], क्या है list1.count (5)?
A) 0
B) 4
C) 1
D) 2 ✔️

308.What arithmetic operators cannot be used with strings?
स्ट्रिंग्स के साथ क्या अंकगणित ऑपरेटरों का उपयोग नहीं किया जा सकता है?
A) +
B) *
C) – ✔️
D) All of the mentioned

309.Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
मान लीजिए कि list1 [3, 4, 5, 20, 5, 25, 1, 3] है, list1.reverse () के बाद list1 क्या है?
A) [3, 4, 5, 20, 5, 25, 1, 3]
B) [1, 3, 3, 4, 5, 5, 20, 25]
C) [25, 20, 5, 5, 4, 3, 3, 1]
D) [3, 1, 25, 5, 20, 5, 4, 3] ✔️

310.Suppose listExample is [3, 4, 5, 20, 5, 25, 1,3], what is list1 after listExample.extend([34, 5])?
मान लीजिए सूची है [3, 4, 5, 20, 5, 25, 1,3], सूची 1 के बाद की सूची 1 क्या है।
A) [3, 4, 5, 20, 5, 25, 1, 3, 34, 5] ✔️
B) [1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
C) [25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
D) [1, 3, 4, 5, 20, 5, 25, 3, 34, 5]

311.Suppose listExample is [3, 4, 5, 20, 5, 25, 1,3], what is list1 after listExample.pop(1)?
मान लीजिए सूची है [3, 4, 5, 20, 5, 25, 1,3], सूची 1 के बाद की सूची 1 क्या है।
A) [3, 4, 5, 20, 5, 25, 1, 3]
B) [1, 3, 3, 4, 5, 5, 20, 25]
C) [3, 5, 20, 5, 25, 1, 3] ✔️
D) [1, 3, 4, 5, 20, 5, 25]

312.Suppose listExample is [3, 4, 5, 20, 5, 25, 1,3], what is list1 after listExample.pop()?
मान लीजिए सूची है। [3, 4, 5, 20, 5, 25, 1,3] सूची 1 के बाद सूची 1 क्या है।
A) [3, 4, 5, 20, 5, 25, 1] ✔️
B) [1, 3, 3, 4, 5, 5, 20, 25]
C) [3, 5, 20, 5, 25, 1, 3]
D) [1, 3, 4, 5, 20, 5, 25]

313.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
>>>”Welcome to Python”.split()
A) [“Welcome”, “to”, “Python”] ✔️
B) (“Welcome”, “to”, “Python”)
C) {“Welcome”, “to”, “Python”}
D) “Welcome”, “to”, “Python”

314. What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
>>>list(“a#b#c#d”.split(‘#’))
A) [‘a’, ‘b’, ‘c’, ‘d’] ✔️
B) [‘a b c d’]
C) [‘a#b#c#d’]
D) [‘abcd’]

315.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
myList = [1, 5, 5, 5, 5, 1]
max = myList[0]
indexOfMax = 0
for i in range(1, len(myList)):
if myList[i] > max:
max = myList[i]
indexOfMax = i
>>>print(indexOfMax)
A) 1 ✔️
B) 2
C) 3
D) 4


316.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcd’.translate({‘a’: ‘1’, ‘b’: ‘2’, ‘c’: ‘3’, ‘d’:’4′}))
A) abcd ✔️
B) 1234
C) error
D) None of the mentioned

317.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘ab’.zfill(5))
A) 000ab ✔️
B) 00ab0
C) 0ab00
D) ab000

318. What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘+99’.zfill(5))
A) 00+99
B) 00099
C) +0099 ✔️
D) +++99

319.Which of the following commands will create a list?
निम्नलिखित में से कौन सी कमांड एक सूची बनाएगी?
A) list1 = list()
B) list1 = []
C) list1 = list([1, 2, 3])
D) all of the mentioned ✔️

320.What is the output when we execute list(“hello”)?
जब हम सूची (“हैलो”) निष्पादित करते हैं तो आउटपुट क्या है?
A) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] ✔️
B) [‘hello’]
C) [‘llo’]
D) [‘olleh’]

321.Suppose listExample is [‘h’,’e’,’l’,’l’,’o’],what is len(listExample)?
मान लीजिए सूची। नमूना [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] है, len (listExample) क्या है?
A) 5 ✔️
B) 4
C) None
D) Error

322.Suppose list1 is [2445,133,12454,123], what is max(list1)?
मान लीजिए कि सूची 1 है [2445,133,12454,123], अधिकतम (सूची 1) क्या है?
A) 2445
B) 133
C) 12454 ✔️
D) 123

323.Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?
मान लीजिए कि सूची 1 है [3, 5, 25, 1, 3], क्या है मिनट (सूची 1)?
A) 3
B) 5
C) 25
D) 1 ✔️

324.Suppose list1 is [1, 5, 9], what is sum(list1)?
मान लीजिए कि सूची 1 है [1, 5, 9], योग (सूची 1) क्या है?
A) 1
B) 9
C) 15 ✔️
D) Error

325.To shuffle the list(say list1) what function do we use?
सूची में फेरबदल करने के लिए (सूची 1 कहिए) हम किस फ़ंक्शन का उपयोग करते हैं?
A) list1.shuffle()
B) shuffle(list1)
C) random.shuffle(list1) ✔️
D) random.shuffleList(list1)

326.Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?
मान लीजिए कि सूची 1 है [4, 2, 2, 4, 5, 2, 1, 0], निम्न में से कौन सा स्लाइसिंग ऑपरेशन के लिए सही वाक्यविन्यास है?
A) print(list1[0])
B) print(list1[:2])
C) print(list1[:-2])
D) All of the mentioned ✔️

327.Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
मान लीजिए कि सूची 1 है [2, 33, 222, 14, 25], सूची 1 [-1] क्या है?
A) Error
B) None
C) 25 ✔️
D) 2

328.Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
मान लीजिए कि सूची 1 है [2, 33, 222, 14, 25], सूची 1 [: – 1] क्या है?
A) [2, 33, 222, 14] ✔️
B) Error
C) 25
D) [25, 14, 222, 33, 2]

329.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
>>>names = [‘Amir’, ‘Bear’, ‘Charlton’, ‘Daman’]
>>>print(names[-1][-1])
A) A
B) Daman
C) Error
D) n ✔️

330.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
names1 = [‘Amir’, ‘Bear’, ‘Charlton’, ‘Daman’]
names2 = names1
names3 = names1[:]
names2[0] = ‘Alice’
names3[1] = ‘Bob’
sum = 0
for ls in (names1, names2, names3):
if ls[0] == ‘Alice’:
sum += 1
if ls[1] == ‘Bob’:
sum += 10
print sum
A) 11
B) 12 ✔️
C) 21
D) 22

Relate Link