O Level - Sequence Data Types In Python
Questions No: 1/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: 2/50

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

print('abef'.partition('cd'))

Questions No: 3/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('yy', 1))

Questions No: 4/50

Suppose d = {"john”:40, “peter":45}. To obtain the number of entries in dictionary which command do we use?
मान लीजिए d = {"john":40, “peter":45}| डिक्शनरी में प्रविष्टियों की संख्या प्राप्त करने के लिए हम किस कमांड का उपयोग करते हैं?

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

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

Questions No: 7/50

Which of the following are valid string manipulation functions in python?
निम्नलिखित में से कौन से पायथन में वैध स्ट्रिंग मैनिपुलेशन फ़ंक्शन हैं?

Questions No: 8/50

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

test = {1:'A', 2:'B', 3:'C'}
del test[1]
test[1] = 'D'
del test[2]
print(len(test))

Questions No: 9/50

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

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

Questions No: 10/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: 11/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: 12/50

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

print('ab cd-ef'.title())

Questions No: 13/50

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

numbers = {}
letters = {}
comb = {}
numbers[1] = 56
numbers[3] = 7
letters[4] = 'B'
comb['Numbers'] = numbers 
comb['Letters'] = letters
print(comb)

Questions No: 14/50

What will be the output of the following?

print(sum(1,2,3))

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

"hello,world".[-6], what value print?
"hello,world".[-6], का आउटपुट क्या होगा?

Questions No: 17/50

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

print('Hello World'.istitle())

Questions No: 18/50

What is a Python dictionary?
पायथन डिक्शनरी क्या है?

Questions No: 19/50

What does the following code print ?

x = 'mohan'
for i in range (len(x)):
       x[i].upper()
print (x)

Questions No: 20/50

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

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

Questions No: 21/50

Which of the following Statement will create a Tuple:
निम्नलिखित में से कौन सा स्टेट्मेंट एक टपल क्रिएट करेगा:

Questions No: 22/50

Choose the correct option with respect to Python..
पायथन के संबंध में सही विकल्प चुनें।

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

What will be the output of the following Python code?

print('abcdef'.partition('cd'))

Questions No: 25/50

What will be the output of the following Python code?

a={1:"A",2:"B",3:"C"}
for i in a: 
    print(i,end=" ")

Questions No: 26/50

What is the output of following code

a=[2,3,4,5]
a.insert(3,1)
print(a)

Questions No: 27/50

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

Questions No: 28/50

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

Questions No: 29/50

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

Questions No: 30/50

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

Questions No: 31/50

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

a={1:"A",2:"B",3:"C"}
for i,j in a.items(): 
    print(i,j,end=" ")

Questions No: 32/50

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

Questions No: 33/50

What will be the output of the following Python code?

a=[10,23,56,[78]]
b=list(a)
a[3][0]=95
a[1]=34
print(b)

Questions No: 34/50

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

Questions No: 35/50

What does the function re-search do?
फंक्शन re-search क्या करता है?

Questions No: 36/50

Which symbol is used to access list elements?
सूची के तत्वों तक पहुँचने के लिए किस प्रतीक का उपयोग किया जाता है?

Questions No: 37/50

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

print('1.1'.isnumeric())



Questions No: 38/50

What is the output of the following statement ?

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

Questions No: 39/50

What will be the output of the following Python code?

d1={"abc":5,"def":6,"ghi":7}
print(d1[0])

Questions No: 40/50

split( ) function returns the _____ of words delimited by the specified substring.
स्प्लिट() फंक्शन निर्दिष्ट सबस्ट्रिंग द्वारा सीमांकित शब्दों का ____ देता है।

Questions No: 41/50

What will be the output?

a={'a':4,'b':6,'a':7}
print(a)

Questions No: 42/50

What will be the output of the following Python code?

>>> a={5,6,7}
>>> sum(a,5)

Questions No: 43/50

What does the strip() method do in Python?
पायथन में स्ट्रिप() विधि क्या करती है?

Questions No: 44/50

What will be the output of following statement ?

>>>"m"+"n1"

Questions No: 45/50

When we open file in append mode the file pointer is at the of the file?
जब हम फाइल को एपेंड मोड में खोलते हैं तो फाइल पॉइंटर फाइल के ____ पर होता है?

Questions No: 46/50

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

print(''.isdigit())

Questions No: 47/50

What will be the output of the following Python code?

a={1:5,2:3,3:4}
a.pop(3) 
print(a)

Questions No: 48/50

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

d = {"john":40, "peter":45}
print("john" in d)

 

Questions No: 49/50

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

a={}
a['a']=1
a['b']=[2,3,4] 
print(a)

Questions No: 50/50

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

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