Python - Working With List
Questions No: 1/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: 2/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: 3/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: 4/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: 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?

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

Questions No: 7/50

What will be the output of the following Python code?

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

Questions No: 8/50

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

Questions No: 9/50

Which of the following is the correct way to check if a value exists in a list?
किसी लिस्ट में कोई मान मौजूद है या नहीं इसकी जाँच करने का निम्नलिखित में से कौन सा सही तरीका है?

Questions No: 10/50

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

Questions No: 11/50

What will be the output of the following code snippet?

a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)

Questions No: 12/50

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

Questions No: 13/50

What will be the output of the following Python code?

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

Questions No: 14/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: 15/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: 16/50

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

Questions No: 17/50

What is the output of the following code:

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

Questions No: 18/50

What will be the output of the following Python code?

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

Questions No: 19/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 row in range(0, len(values)):
    for column in range(0, len(values[row])):
        if v < values[row][column]:
            v = values[row][column]
print(v)

Questions No: 20/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)

Questions No: 21/50

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

Questions No: 22/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: 23/50

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

Questions No: 24/50

What will be the output of the following Python code?

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

Questions No: 25/50

Suppose i is 5 and j is 4, i + j is same as ________
मान लीजिए कि i 5 है और j 4 है, i + j ________ के समान है

Questions No: 26/50

What is the correct command to shuffle the following list?

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

Questions No: 27/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: 28/50

What will be the output of the following Python code?

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

Questions No: 29/50

Suppose list1 is [1, 3, 2], What is list1 * 2?
मान लीजिए लिस्ट 1 [1, 3, 2] है,लिस्ट 1 * 2 क्या है?

Questions No: 30/50

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

Questions No: 31/50

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

Questions No: 32/50

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)

Questions No: 33/50

What will be the output of the following Python code?

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

Questions No: 34/50

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

Questions No: 35/50

What function do you use to read a string?
एक स्ट्रिंग को रीड करने के लिए आप किस फ़ंक्शन का यूज़ करते हैं?

Questions No: 36/50

Suppose list1 is [1, 5, 9], what is sum(list1)?
मान लीजिए कि लिस्ट1 है [1, 5, 9],sum (लिस्ट1) क्या है?

Questions No: 37/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: 38/50

To shuffle the list(say list1) what function do we use?
लिस्ट में शफल (फेरबदल) करने के लिए (say list1) हम किस फ़ंक्शन का यूज़ करते हैं?

Questions No: 39/50

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

for i in [1, 2, 3, 4][::-1]:
    print (i)

Questions No: 40/50

What is the output of the following code?

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

Questions No: 41/50

What is the output when we execute list("hello")?
जब हम list ( "hello") निष्पादित करते हैं तो आउटपुट क्या है?

Questions No: 42/50

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

Questions No: 43/50

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

Questions No: 44/50

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

Questions No: 45/50

What will be the output of the following Python code?

def m(list):
    v = list[0]
    for e in list:
        if v < e:
            v = e
    return v
   
values = [[3, 4, 5, 1], [33, 6, 1, 2]]   
for row in values: 
      print(m(row), end = " ")

Questions No: 46/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: 47/50

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

Questions No: 48/50

What will be the output of the following Python code?

mylist=list("a#b#c#d".split('#'))
print(mylist)

Questions No: 49/50

What will happen if you try to access a key that doesn’t exist in a dictionary?
यदि आप किसी ऐसी की तक पहुंचने का प्रयास करते हैं जो ड़िक्शनरी में मौजूद नहीं है तो क्या होगा?

Questions No: 50/50

Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?
मान लीजिए कि लिस्ट 1 है [3, 5, 25, 1, 3],मिनट (लिस्ट 1)क्या है ?