O Level - Sequence Data Types In Python
Questions No: 1/50

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

Questions No: 2/50

What will be the output of the following Python code?

string = "my name is x"
for i in string.split():
    print (i, end=", ")

Questions No: 3/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: 4/50

Which of the following statements is used to create an empty set?
एम्प्टी सेट क्रिएट करने के लिए निम्नलिखित में से किस स्टेट्मेंट का यूज़ किया जाता है?

Questions No: 5/50

What will be the output of the following Python code?

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

Questions No: 6/50

What will be the output of the following ?

print((range(4)))

Questions No: 7/50

List is mutable and Tuple is immutable?
लिस्ट परिवर्तनशील है और टपल अपरिवर्तनीय है?

Questions No: 8/50

What is the output of the following program ? print "Hello World".[::-1]
निम्नलिखित प्रोग्राम का आउटपुट क्या है? print "Hello World".[::-1]

Questions No: 9/50

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

Questions No: 10/50

What is the correct command to shuffle the following list?

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

Questions No: 11/50

What is the output of the following code? print(len("Python\nProgramming"))
निम्नलिखित कोड का आउटपुट क्या है? print(len("Python\nProgramming"))

Questions No: 12/50

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

a={1:"A",2:"B",3:"C"}
a.setdefault(4,"D") 
print(a)

Questions No: 13/50

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

 a = {}
a[1] = 1
a['1'] = 2
a[1.0]=4
count = 0
for i in a:
    count += a[i]
print(count)
print(a)

Questions No: 14/50

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

print('abcdef12'.replace('cd', '12'))

Questions No: 15/50

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

Questions No: 16/50

What will be the output of the following Python code?

x = "abcdef"
i = "a"
while i in x:
    x = x[1:]
    print(i, end = " ")

Questions No: 17/50

What will be the output of the following Python code?

count={}
count[(1,2,4)] = 5
count[(4,2,1)] = 7
count[(1,2)] = 6
count[(4,2,1)] = 2
tot = 0
for i in count:
    tot=tot+count[i]
print(len(count)+tot)

Questions No: 18/50

Which of the following function of dictionary gets all the keys from the dictionary
निम्नलिखित में से डिक्शनरी का कौन सा फ़ंक्शन डिक्शनरी से सभी की निकालने के लिए किया जाता है

Questions No: 19/50

What will be the output of the following Python code?

a={1:"A",2:"B",3:"C"}
print(a.items())

Questions No: 20/50

Which method is used to access some part of a string or substring.
स्ट्रिंग या सबस्ट्रिंग के कुछ भाग को एक्सेस करने के लिए किस विधि का उपयोग किया जाता है।

Questions No: 21/50

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

print('abcdefcdghcd'.split('cd', 0))

Questions No: 22/50

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

Questions No: 23/50

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

Questions No: 24/50

What is the correct way to create a tuple with a single element?
किसी सिंगल एलिमेंट से टपल क्रिएट करने का सही तरीका क्या है?

Questions No: 25/50

What is the output of the following program:

print ("Hello World"[::-1])

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

What will be the output of the following Python code?

print('1Rn@'.lower())

Questions No: 28/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: 29/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: 30/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: 31/50

what is the output of the following code?

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

Questions No: 32/50

In which of the following data type, duplicate items are not allowed ?
निम्नलिखित में से किस डेटा प्रकार में डुप्लीकेट आइटम की अनुमति नहीं है?

Questions No: 33/50

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

>>> a={1:"A",2:"B",3:"C"}
>>> del a

Questions No: 34/50

What will be the output of the following Python code?

a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b) 
print(a)

Questions No: 35/50

What will be the output of the following Python code?

print("abcdef".find("cd") == "cd" in "abcdef")

Questions No: 36/50

What data type is the object below ?

L=[1, 23, 'hello', 1]

Questions No: 37/50

How can you find the number of occurrences of an element in a tuple?
आप टपल में किसी एलिमेंट की अक्युरेन्सेस के नंबर को कैसे फाइंड कर सकते हैं?

Questions No: 38/50

Dictionary has:
डिक्सनरी में है:

Questions No: 39/50

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

Questions No: 40/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: 41/50

What is the output of the following statement ?

print ((2, 4) + (1, 5))

Questions No: 42/50

What type of data is: a=[(1,1),(2,4),(3,9)]?
किस प्रकार का डेटा है: a = [(1,1), (2,4), (3,9)]?

Questions No: 43/50

What will be the output of the following Python code?

example = "helle"
print(example.find("e"))

Questions No: 44/50

Which of the following methods is used to check if a string starts with a specific prefix?
निम्नलिखित में से किस मेथड का यूज़ यह चेक करने के लिए किया जाता है कि कोई स्ट्रिंग किसी स्पेसिफ़िक प्रीफ़िक्स से स्टार्ट होती है या नहीं?

Questions No: 45/50

If a=(1,2,3,4), a[1:-1] is _________
यदि a = (1,2,3,4), एक [1: -1] _________ है

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

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
    print(d[x])

Questions No: 48/50

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

d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
print(d1 > d2)

 

 

 

Questions No: 49/50

If a is a dictionary with some key-value pairs, what does a.popitem() do?
यदि कुछ की-वैल्यू वाले पेअर के साथ एक ड़िक्शनरी है,तो a.popitem () क्या करता है?

Questions No: 50/50

What will be the output of the following Python code?

print('abcdefcdgh'.partition('cd'))