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]]
v = values[0][0]
for lst in values:
    for element in lst:
        if v > element:
            v = element
print(v)

Questions No: 2/50

If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function:
यदि हमारे पास दो सेट हैं, s1 और s2, और हम यह चेक करना चाहते हैं कि s1 के सभी एलिमेंट s2 में मौजूद हैं या नहीं, हम फ़ंक्शन का यूज़ कर सकते हैं:

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

Which of the statements about dictionary values if false?
ड़िक्शनरी वैल्यूज में से कौन सा स्टेट्मेंट यदि गलत है?

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=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)


Questions No: 7/50

What will be the output of the following Python code?

print('Hello!2@#World'.istitle())

Questions No: 8/50

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

Questions No: 9/50

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

print('HelloWorld'.istitle())

Questions No: 10/50

Which of the following is a mapping datatype?
निम्न में से कौन एक मैपिंग डेटाटाइप है?

Questions No: 11/50

What will be the output of the following ?

print((range(4)))

Questions No: 12/50

Suppose d = {“john”:40, “peter”:45}, what happens when we try to retrieve a value using the expression d[“susan”]?
मान लीजिए कि d = {"जॉन": 40, "पीटर": 45}, तब क्या होता है जब हम एक्सप्रेशन का यूज़ करते हुए value प्राप्त करने का प्रयास करते हैं d[“susan”]?

Questions No: 13/50

What will be the output of the following Python expression?

x=24//6%3, 24//4//2
print(x)

Questions No: 14/50

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

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

Questions No: 15/50

What will be the output of the following Python code?

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

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

What will be the output of the following Python code?

print(max("what are you"))

Questions No: 19/50

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

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

Questions No: 20/50

What will be the output of the following Python code?

a=dict()
print(a[1])

Questions No: 21/50

What is the output of the following code:

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

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

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

Questions No: 25/50

What will be the output of the following code?

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

Questions No: 26/50

lstrip() method is used for :
lstrip () फंक्शन का उपयोग इसके लिए किया जाता है:

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

What will be the output of the following Python code?

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

Questions No: 29/50

What will be the output of the following Python code?

>>> a={4,5,6}  >>> b={2,8,6}  >>> a-b

Questions No: 30/50

What will be the output of the following Python code?

  1.   numberGames = {}
  2.   numberGames[(1,2,4)] = 8
  3.   numberGames[(4,2,1)] = 10
  4.   numberGames[(1,2)] = 12
  5.   sum = 0
  6. for k in numberGames:
  7.       sum += numberGames[k]
  8.   print len(numberGames) + sum

Questions No: 31/50

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

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

Questions No: 32/50

What will be the output of the following Python code?

print('ab'.isalpha())

Questions No: 33/50

What will be the output of the following Python code?

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

Questions No: 34/50

Which of the following isn’t true about dictionary keys?
निम्नलिखित में से कौन ड़िक्शनरी keys के बारे में सही नहीं है?

Questions No: 35/50

Which one the following is a mutable data type ?
निम्नलिखित में से कौन सा एक परिवर्तनशील डेटा प्रकार है?

Questions No: 36/50

what is the output of the following code?

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

Questions No: 37/50

Which function is used to add an element (5) in the list1?
लिस्ट 1 में एक एलिमेंट (5 ) जोड़ने के लिए किस फंक्शन का प्रयोग किया जाता है ?

Questions No: 38/50

What does the following code print ?

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

Questions No: 39/50

What will be the output of the following Python code?

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

Questions No: 40/50

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

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

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

Questions No: 43/50

What will be the output of the following Python code?

print("Welcome to Python".split())

Questions No: 44/50

What will be the output of the following Python code?

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

Questions No: 45/50

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

Questions No: 46/50

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

Questions No: 47/50

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

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

Questions No: 48/50

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

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

Questions No: 49/50

What will be the output of the following Python code?

print('xyxxyyzxxy'.lstrip('xyy'))

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