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

What will be the output of the following Python code?

x = 'abcd'
for i in x:
    print(i)
    x.upper()

Questions No: 2/50

What will be the output of the following Python code?

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

Questions No: 3/50

What happens if you attempt to access an index that is out of range in a list?
यदि आप किसी ऐसे इंडेक्स तक पहुँचने का प्रयास करते हैं जो किसी लिस्ट के रेंज से बाहर है तो क्या होगा?

Questions No: 4/50

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

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

Questions No: 5/50

What is the output of the following program:

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

Questions No: 6/50

What will be the output of the following Python code?

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

Questions No: 7/50

What will be the output of the following Python code?

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

Questions No: 8/50

What will be the output of the following Python code?

str1="helloworld"
print(str1[::-1])

Questions No: 9/50

What will be the output of the following Python code?

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

Questions No: 10/50

What will be the output of the following Python code?

example = "NITIN"
print(example.rfind("N"))

Questions No: 11/50

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

Questions No: 12/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy", 0, 2))

Questions No: 13/50

Which of the following function returns the index value of first occurrence of substring occurring in the given string.
निम्नलिखित में से कौन सा फंक्शन दिए गए स्ट्रिंग में होने वाली सबस्ट्रिंग के पहले अकरेन्स की इन्डेक्स वैल्यू देता है।

Questions No: 14/50

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

print('xyyxyyxyxyxxy'.replace('xy', '12', 100))

Questions No: 15/50

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

Questions No: 16/50

If a={5,6,7}, what happens when a.add(5) is executed?
यदि a = {5,6,7}, तो क्या होता है जब a.add (5) निष्पादित होता है?

Questions No: 17/50

What is the output of the following code?

a = set('dcma')
b = set('mlpc')
print(a^b)

Questions No: 18/50

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

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

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

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

Questions No: 21/50

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

Questions No: 22/50

What does the following code print ?

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

Questions No: 23/50

What will be the output of the following Python code?

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

Questions No: 24/50

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

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

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

What will be the output of the following Python code?

 word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)

Questions No: 27/50

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

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

Which of the following is true about Python strings?
पायथन स्ट्रिंग्स के बारे में निम्नलिखित में से कौन सा सत्य है?

Questions No: 30/50

Which of the following lines of code will result in an error?
कोड की निम्नलिखित लाइन्स में से कौन सा एरर होगा ?

Questions No: 31/50

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

Questions No: 32/50

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

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

Which function returns the exact copy of the string with the first letter in uppercase.
कौन सा फंक्शन अपरकेस में पहले अक्षर के साथ स्ट्रिंग की सटीक प्रतिलिपि देता है।

Questions No: 35/50

Which predefined Python function is used to find length of String()
किस पूर्वनिर्धारित पायथन फंक्शन का उपयोग लंबाई को फाइन्ड के लिए किया जाता है।

Questions No: 36/50

What will be the output of following statement ?

>>>"m"+"n1"

Questions No: 37/50

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

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

Questions No: 38/50

What will be the output of the following Python code?

a={5,6,7,8}
b={7,8,9,10} 
print(len(a+b))

Questions No: 39/50

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

Questions No: 40/50

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

Questions No: 41/50

What will be the output of the following Python code?

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

Questions No: 42/50

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

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

Questions No: 43/50

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

Questions No: 44/50

What will be the output of the following Python code?

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

Questions No: 45/50

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

print(''.isdigit())

Questions No: 46/50

What will be the output of the following Python code?

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

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

Which of the following is a Python tuple?
निम्नलिखित में से कौन एक Python tuple है?

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

Which one of the following is inmmutable data type?