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

What will be printed?

a = [1, 2, 3]
print(a * 2)

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

What will be the output of the following ?

print((range(4)))

Questions No: 4/50

What will be the output of the following Python code?

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

Questions No: 5/50

If wd="Hello World" then which of the following statements will display last five characters of the string object?

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

What will be the output of the following Python code?

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

Questions No: 8/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: 9/50

Which of these about a set is not true?
इनमें से कौन सा एक सेट के बारे में सही नहीं है?

Questions No: 10/50

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

Questions No: 11/50

What does the update() method do in a dictionary?
अपडेट() मेथड किसी ड़िक्शनरी में क्या करती है?

Questions No: 12/50

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

Questions No: 13/50

arr[::-1] does what?
arr[::-1] क्या करता है?

Questions No: 14/50

What will be the output of the following Python code?

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

Questions No: 15/50

The ____________ function removes the first element of a set and the last element of a list.
____________ फ़ंक्शन सेट का फर्स्ट एलिमेंट् और किसी लिस्ट का लास्ट एलिमेंट निकालता है।

Questions No: 16/50

Which of the following is not a declaration of the dictionary?
निम्नलिखित में से कौन सा ड़िक्शनरी का डिक्लेरेशन नहीं है?

Questions No: 17/50

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

Questions No: 18/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: 19/50

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

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

Questions No: 20/50

What will be the output of the following Python code?

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

Questions No: 21/50

What will be the output of the following Python code?

example = "snow world"
example[3] = 's'
print (example)

Questions No: 22/50

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

print('abc'.islower())

Questions No: 23/50

What will be the output of the following Python code?

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

Questions No: 24/50

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

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

Questions No: 25/50

What will be the output of the following Python code?

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

Questions No: 26/50

Which of the following is a valid way to create an empty tuple?
निम्नलिखित में से कौन सा एक एम्प्टी टपल क्रिएट करने का वैध तरीका है?

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

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

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

Questions No: 29/50

What will be the output of the following Python code?

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

Questions No: 30/50

What will be the result?

a = [1, 2, 3]
print(a[1:])

Questions No: 31/50

Which of the following function returns True if the string is non empty and has all uppercase alphabets.
यदि स्ट्रिंग नॉन-इम्पटी है और सभी अपरकेस अक्षर हैं, तो निम्न में से कौन सा फंक्शन सही है।

Questions No: 32/50

Given a string s="Welcome", which of the following code is incorrect ?
एक स्ट्रिंग s="Welcome" में निम्नलिखित में से कौन सा कोड गलत है?

Questions No: 33/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: 34/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy"))

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

Which of the following operations is NOT allowed on a tuple?
टपल पर निम्नलिखित में से किस ऑपरेशन की अनुमति नहीं है?

Questions No: 38/50

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

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

What will be the output of the following Python code?

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

Questions No: 41/50

What will be the output of the following Python code?

>>>max("what are you")

Questions No: 42/50

What will be the output of the following Python code?

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

Questions No: 43/50

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

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

Questions No: 44/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: 45/50

What will be the output?

t = (1, 2, 3)
t[1] = 5
print(t)

Questions No: 46/50

What will be the output of the following Python code?

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

Questions No: 47/50

what will the output of following code

my_string="Hello,world"
print(my_string[-6:-1])

Questions No: 48/50

What will be the output?

d = {"a": 1, "b": 2}
print(2 in d)

Questions No: 49/50

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

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