Python - Working With List
Questions No: 1/50

what is the output of the following code?

M=['b' *x for x in range(4)]
print(M)

Questions No: 2/50

To remove string “hello” from list1, we use which command?
लिस्ट1 से स्ट्रिंग "हैलो" को रिमूव करने के लिए, हम किस कमांड का यूज़ करते हैं?

Questions No: 3/50

What is the correct command to shuffle the following list?

fruit=['apple', 'banana', 'papaya', 'cherry']

Questions No: 4/50

The data structure which is a mutable ordered sequence of elements is called
डेटा संरचना जो तत्वों का एक परिवर्तनशील क्रमबद्ध अनुक्रम है, कहलाती है

Questions No: 5/50

What happens if you attempt to access an index that is out of range in a list?
यदि आप किसी ऐसे इंडेक्स तक पहुँचने का प्रयास करते हैं जो किसी लिस्ट के रेंज से बाहर है तो क्या होगा?

Questions No: 6/50

What will be the output of the following Python code?

a= [1, 2, 3, 4, 5]
for i in range(1, 5):
    a[i-1] = a[i]
for i in range(0, 5):
    print(a[i],end = " ")

Questions No: 7/50

To add a new element to a list we use which Python command?
लिस्ट में एक नया आइटम जोड़ने के लिए हम किस पायथन कमांड का उपयोग करते हैं?

Questions No: 8/50

Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?
मान लीजिए कि list1 [3, 4, 5, 20, 5] है, list1.index (5) क्या है?

Questions No: 9/50

What will be the output of the following Python code?

x = ['ab', 'cd']
for i in x:
    i.upper() 
print(x)

Questions No: 10/50

What will be the output of the following Python code?

data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
def ttt(m):
    v = m[0][0]
    for row in m:
        for element in row:
            if v < element: v = element     
        return v
print(ttt(data[0]))

Questions No: 11/50

Which statement is correct
कौन सा कथन सही है

Questions No: 12/50

Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is the value of list1.count(5)?
मान लीजिए list1 [3, 4, 5, 20, 5, 25, 1, 3], है, list1.count(5) की क्या वैल्यू है।

Questions No: 13/50

What is the output when we execute

list("hello") ? 

Questions No: 14/50

Which statement is correct??
कौन सा कथन सही है??

Questions No: 15/50

Suppose list1 is [2445,133,12454,123], what is max(list1)?
मान लीजिए कि लिस्ट 1 है [2445,133,12454,123],Max (लिस्ट1) क्या है?

Questions No: 16/50

Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:
मान लीजिए कि list1 = [0.5 * x for x in range(0, 4)], list1 है:

Questions No: 17/50

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], listExample.pop() के बाद लिस्ट1 क्या है।

Questions No: 18/50

Suppose a list with name arr, contains 5 elements. You can get the 2nd element from the list using:
मान लीजिए कि arr नाम वाली एक सूची में 5 एलिमेन्ट हैं। आप सूची से दूसरा एलिमेन्ट प्राप्त कर सकते हैं:

Questions No: 19/50

What will be the output of the following Python code?

list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)

Questions No: 20/50

What will be the output of the following Python code snippet?

a = [0, 1, 2, 3]
for a[-1] in a:
    print(a[-1])

Questions No: 21/50

What will be the output of the following code?

list1=[2,33,222,14,25]
print(list1[-1])

Questions No: 22/50

Assume q= [3, 4, 5, 20, 5, 25, 1, 3], then what will be the items of q list after q.pop(1) ?
मान लीजिए q= [3, 4, 5, 20, 5, 25, 1, 3], तो q.pop(1) के बाद q सूची में क्या आइटम होंगे?

Questions No: 23/50

What will be the output of the following Python code?

values = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for lst in values:
    for element in lst:
        if v > element:
            v = element
print(v)

Questions No: 24/50

To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?
स्ट्रिंग 3 = &quot;हैलो&quot; से इंडेक्स 3 पर character को रिट्रीव करने के लिए हम किस कमांड को एक्सक्यूट करते हैं (multiple answers allowed)?

Questions No: 25/50

Suppose a list with name arr, contains 5 elements. You can get the 2nd element from the list using :
मान लीजिए arr नाम वाली एक सूची में 5 तत्व हैं। आप सूची से दूसरा तत्व प्राप्त कर सकते हैं:

Questions No: 26/50

To return the length of string s what command do we execute?
स्ट्रिंग की लेंथ रिटर्न करने के लिए हम किस कमांड को एक्सक्यूट करते हैं?

Questions No: 27/50

Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
मान लीजिए कि लिस्ट 1 है [2, 33, 222, 14, 25], लिस्ट 1 [-1] क्या है?

Questions No: 28/50

Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
मान लीजिए कि लिस्ट-एग्जाम्पल [‘h’,, e ’,, l’,, l ’,’ o ’] है, तो len (listExample) क्या है?

Questions No: 29/50

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], निम्न में से कौन सा स्लाइसिंग ऑपरेशन के लिए करेक्ट सिन्टैक्स है?

Questions No: 30/50

What will be the output of the following Python code?

matrix = [[1, 2, 3, 4],
         [4, 5, 6, 7],
         [8, 9, 10, 11],
         [12, 13, 14, 15]]  
for i in range(0, 4):
      print(matrix[i][1], end = " ")

Questions No: 31/50

What will be the output of the following Python code?

a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)


Questions No: 32/50

What is the output of the following code:

L=['a','b','c','d']
print ( "".join(L))

Questions No: 33/50

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 क्या है?

Questions No: 34/50

What is “Hello”.replace(“l”, “e”)?
&quot;हैलो&quot; .replace (&quot;l&quot;, &quot;e&quot;) क्या है?

Questions No: 35/50

To remove string "hello" from list1, we use which command ?
लिस्ट 1 से स्ट्रिंग "हैलो" को हटाने के लिए, हम किस कमांड का उपयोग करते हैं?

Questions No: 36/50

What will be the output of the following Python code?

values = [[3, 4, 5, 1 ], [33, 6, 1, 2]]
for row in values:
    row.sort()
    for element in row:
        print(element, end = " ")
    print()

Questions No: 37/50

What will be the output of the following ?

print((range(4)))

Questions No: 38/50

What will be the output of the following Python code?

places = ['Bangalore', 'Mumbai', 'Delhi']
places1 = places
places2 = places[:]
places1[1]="Pune"
places2[2]="Hyderabad"
print(places)

Questions No: 39/50

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) क्या है?

Questions No: 40/50

What will be the output of the following Python code?

 word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)

Questions No: 41/50

How can we create an empty list in Python ?
हम पायथन में एक खाली लिस्ट कैसे बना सकते हैं?

Questions No: 42/50

Which of the following methods will create a copy of a list?
निम्नलिखित में से कौन सा मेथड किसी लिस्ट की एक कॉपी क्रिएट करेगी ?

Questions No: 43/50

What will be the output of the following Python code?

names = ['Amir', 'Bear', 'Charlton', 'Daman']
print(names[-1][-1])

Questions No: 44/50

What will be the output of the following Python code?

a=["Apple","Ball","Cobra"]
a.sort(key=len)
print(a)

Questions No: 45/50

To insert 5 to the third position in list1, we use which command?
लिस्ट 1 में 5 से थर्ड पोज़िशन पर इन्सर्ट करने के लिए, हम किस कमांड का यूज़ करते हैं?

Questions No: 46/50

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] ,listExample.extend([34, 5]) के बाद की लिस्ट1 क्या है।

Questions No: 47/50

which function is used to remove last item from a list?
किसी लिस्टसे अंतिम आइटम को हटाने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

Questions No: 48/50

What will be the output of the following Python code?

def f(values):
    values[0] = 44
   
v = [1, 2, 3]
f(v)
print(v)

Questions No: 49/50

What will be the output of the following Python code?

list1 = [11, 2, 23]
list2 = [11, 2, 2]
print(list1 < list2)

Questions No: 50/50

What will be the output of the following Python code?

points = [[1, 2], [3, 1.5], [0.5, 0.5]]
points.sort()
print(points)