0% found this document useful (0 votes)
12 views102 pages

Chapter 5 Sequence Data Type MCQ

The document contains a series of multiple-choice questions related to Python programming, covering topics such as data types, functions, and code outputs. Each question presents a code snippet or concept followed by four answer options. The questions are designed to test the reader's understanding of Python syntax and behavior.

Uploaded by

nice29705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views102 pages

Chapter 5 Sequence Data Type MCQ

The document contains a series of multiple-choice questions related to Python programming, covering topics such as data types, functions, and code outputs. Each question presents a code snippet or concept followed by four answer options. The questions are designed to test the reader's understanding of Python syntax and behavior.

Uploaded by

nice29705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 102

MCQ Question & Answer

Chapter [5]

Sequence
Data Type
LESSION 5 OF 9

Contact Us
JOIN US ON for Free Course +91-9027902171
Q1. डिक्शनरी का कौन सा फ़ंक्शन सभी कीज़ को डिक्शनरी से प्राप्त करता है?
Which of the following function of dictionary gets all the keys from the
dictionary?

m = {'a': 1, 'b': 2, 'c': 3}


print(m.keys())
(A) getkeys()
(B) key()
(C) keys()
(D) None of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q2. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

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

(A) Error, no method called update for set data type


(B) {1, 2, 3, 4, 5}
(C) Error, list can't be added to set
(D) Error, duplicate item present in list
Contact Us
JOIN US ON for Free Course +91-9027902171
Q3. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = {1, 2, 3}
a.intersection_update({2, 3, 4, 5})
print(a)

(A) {2, 3}
(B) Error, duplicate item present in list
(C) Error, no method called intersection_update for set data type
(D) {1, 4, 5}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q4. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

a = {1, 2, 3}
print({x*2 for x in a | {4, 5}})

(A) {2, 4, 6}
(B) Error, set comprehensions aren't allowed
(C) {8, 2, 10, 4, 6}
(D) {8, 10}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q5. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
n = [m[i][2-i] for i in range(len(m))]
print(n)

(A) [1, 5, 9]
(B) [3, 5, 7]
(C) [3, 5, 7, 9]
(D) [3, 5, 7, 8]
Contact Us
JOIN US ON for Free Course +91-9027902171
Q6. डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा?
What will be the output of the following statements?

x = ['25', 'Today', '53', 'Sunday', '15']


x.sort()
print(x)

(A) ['Today', 'Sunday', '15', '25', '53']


(B) ['Sunday', 'Today', '15', '25', '53']
(C) ['15', '25', '53', 'Sunday', 'Today']
(D) ['15', '25', '53', 'Today', 'Sunday']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q7. डनम्नलिखित का आउटपुट क्या होगा?
What is the output of the following?

d = {0: 'a', 1: 'b', 2: 'c'}


for i in d:
print(i)

(A) 0 1 2
(B) a b c
(C) 0 a 1 b 2 c
(D) None of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q8. डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा?
What will be the output of the following statements?
x = [25, 'Today', 53, 'Sunday', 15]
x.reverse()
print(x)

(A) ['Today', 'Sunday', 15, 25, 53]


(B) [15, 'Sunday', 53, 'Today', 25]
(C) [15, 25, 53, 'Sunday', 'Today']
(D) [15, 25, 53, 'Today', 'Sunday']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q9. डनम्नलिखित में कौन सी कमा़ंि लिस्ट बनाता है?
Which of the following commands will create a list?
(A) list1 = list()
(B) list1 = []
(C) list1 = list([1, 2, 3])
(D) All of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q10. डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा?
What will be the output of the following statements?

m = {'Listen': 'Music', 'Play': 'Games'}


n = list(m.items())
print(n)

(A) [('Listen', 'Music'), ('Play', 'Games')]


(B) [('Listen', 'Music')]
(C) [('Play', 'Games')]
(D) ('Play', 'Games'), ('Listen', 'Music')
Contact Us
JOIN US ON for Free Course +91-9027902171
Q11. यदि b एक डिक्शनरी है, तो कोई भी (b) क्या करता है?
If b is a dictionary, what does any(b) do?
(A) Returns True if any key of the dictionary is true
(B) Returns False if dictionary is empty
(C) Returns True if all keys of the dictionary are true
(D) Method any() doesn’t exist for dictionary

Contact Us
JOIN US ON for Free Course +91-9027902171
Q12. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
l = [10, 20, 30, 40, 50]
r = [x//10 for x in l]
print(r)

(A) [1, 2, 3, 4, 5]
(B) [10, 20, 30, 40, 50]
(C) [2, 4, 6, 8, 10]
(D) [0, 1, 2, 3, 4]
Contact Us
JOIN US ON for Free Course +91-9027902171
Q13. नीचे दिया गया ऑब्जेक्ट डकस प्रकार का िेटा है?
What data type is the object below?
L = [1, 23, 'hello', 1]

(A) List
(B) Dictionary
(C) Tuple
(D) Array

Contact Us
JOIN US ON for Free Course +91-9027902171
Q14. कौन सा कथन सही है?
Which statement is correct?

(A) List is mutable & Tuple is immutable


(B) List is immutable & Tuple is mutable
(C) Both List and Tuple are Mutable
(D) Both List and Tuple are Immutable

Contact Us
JOIN US ON for Free Course +91-9027902171
Q15. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

a = frozenset([5, 6, 7])
a.add(5)

(A) Yes, now is a {5, 5, 6, 7}


(B) No, frozen set is immutable
(C) No, invalid syntax for add method
(D) Yes, now a is {5, 6, 7}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q16. What will be the output of the following statements?
डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा ?

x = [5, 4, 3, 2, 1]
x.reverse()
print(x)

(A) [0, 1, 2, 3, 4, 5]
(B) [0, 5, 4, 3, 2, 1]
(C) [5, 4, 3, 2, 1, 0]
(D) [1, 2, 3, 4, 5]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q17. What will be the output after the following statements?
डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा ?

m = ['July', 'September', 'December']


n = m[1]
print(n)

(A) ['July', 'September', 'December']


(B) July
(C) September
(D) December

Contact Us
JOIN US ON for Free Course +91-9027902171
Q18. What will be the output after the following statements?
डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा ?

m = {'m', 'n', 'o', 'p'}


if 'n' in m:
print('n', end=' ')

(A) n
(B) mnop
(C) m n o p
(D) {'m', 'n', 'o', 'p'}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q19. What will be the output after the following statements?
डनम्नलिखित स्टेटमेंट्स का आउटपुट क्या होगा ?
m = [25, 34, 70, 63]
n = str(m[1]) + str(m[2])
print(n)

(A) 2534
(B) 95
(C) 104
(D) 3470
Contact Us
JOIN US ON for Free Course +91-9027902171
Q20. What will be the output of the following Python code?
डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
points = [[1, 2], [3, 1.5], [0.5, 0.5]]
points.sort()
print(points)

(A) [[1, 2], [3, 1.5], [0.5, 0.5]]


(B) [[3, 1.5], [1, 2], [0.5, 0.5]]
(C) [[0.5, 0.5], [1, 2], [3, 1.5]]
(D) [[0.5, 0.5], [3, 1.5], [1, 2]]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q21. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
(What will be the output of the following Python code?)

l = [x2 for x in range(5)]


print(l)

(A) [0, 1, 4, 9, 16]


(B) [1, 4, 9, 16, 25]
(C) [0, 1, 8, 27, 64]
(D) [1, 4, 9, 16, 36]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q22. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
(What will be the output of the following Python code?)

l = [x for x in range(10) if x % 2 == 0]
print(l)

(A) [1, 3, 5, 7, 9]
(B) [2, 4, 6, 8, 10]
(C) [0, 2, 4, 6, 8]
(D) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q23. डनम्नलिखित प्रोग्राम का आउटपुट क्या है?
(What is the output of the following program?)

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

(A) dlroWolleH
(B) Hello Worl
(C) d
(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q24. एक स्ट्ऱंग s="Welcome" में डनम्नलिखित में से कौन सा कोि गित है?
(Given a string s="Welcome", which of the following code is incorrect?)

(A) print s[0]


(B) print s.lower()
(C) s[1]='r'
(D) print s.strip()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q25. अगर wd="Hello World" है तो डनम्नलिखित में से कौन सा कथन स्ट्ऱंग ऑब्जेक्ट के
अ़ं ततम पा़ंच कैरेक्टर को प्रिलशि त करेगा?
(If wd="Hello World", then which of the following statements will display
the last five characters of the string object?)

(A) wd[4:]
(B) wd[:4]
(C) wd[-5:]
(D) wd[:-4]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q26. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
(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)

(A) ['Bangalore', 'Pune', 'Hyderabad']


(B) ['Bangalore', 'Pune', 'Delhi']
(C) ['Bangalore', 'Mumbai', 'Delhi']
(D) ['Bangalore', 'Mumbai', 'Hyderabad']
Contact Us
JOIN US ON for Free Course +91-9027902171
Q27. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
(What will be the output of the following ?)
print([i + j for i in "abc" for j in "def"])

(A) ['da', 'ea', 'fa', 'db', 'eb', 'fb', 'dc', 'ec', 'fc']
(B) [['ad', 'bd', 'cd'], ['ae', 'be', 'ce'], ['af', 'bf', 'cf']]
(C) [['da', 'db', 'dc'], ['ea', 'eb', 'ec'], ['fa', 'fb', 'fc']]
(D) ['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q28. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
(What will be the output of the following Python code?)
[x-1 for x in [1, 2, 3]]

(A) Incorrect
(B) [1/x for x in [(1, 2, 3)]]
(C) [1/x for x in (1, 2, 3)]
(D) error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q29. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
l = [1, 2, 3, 4, 5]
l = [x & 1 for x in l]
print(l)

(A.) [1, 1, 1, 1, 1]
(B.) [1, 0, 1, 0, 1]
(C.) [1, 0, 0, 0, 0]
(D.) [0, 1, 0, 1, 0]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q30. मान िीजिए डक list1 [3, 4, 5, 20, 5] है, list1.index(5) क्या है?
Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?

(A.) 0
(B.) 1
(C.) 4
(D.) 2

Contact Us
JOIN US ON for Free Course +91-9027902171
Q31. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

t1 = (1, 2, 4, 3)
t2 = (1, 2, 3, 4)
print(t1 < t2)

(A.) True
(B.) False
(C.) Error in code
(D.) (1, 2, 4, 3)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q32. डनम्नलिखित में से कौन सा सेट बनाने के लिए सही जसिं टक्स
ै नहीं है?
Which of the following is not the correct syntax for creating a set?

(A.) set([[1,2],[3,4]])
(B.) set([1,2,2,3,4])
(C.) set((1,2,3,4))
(D.) {1,2,3,4}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q33. टपि में मानों तक पहुँचने के लिए, उस इ़ं िेक्स पर उपिब्ध मूल्य प्राप्त करने के लिए इ़ं िेक्स
या इ़ं िेक्स के साथ स्लाइजसिं ग के लिए स्क्वायर ब्रैकेट का उपयोग करें।
To access values in tuple, use the square brackets for slicing along with the
index or indices to obtain value available at that index.

(A.) True
(B.) False
(C.) Can't say
(D.) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q34. अिग-अिग टपि एलिमेंट को हटाना स़ंभव है।
Removing individual tuple elements is possible.

(A.) True
(B.) False
(C.) Can't say
(D.) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q35. िाईं ओर से नकारात्मक दगनती
Negative count from the right.

(A.) L[-2]
(B.) L[-1]
(C.) L[-end]
(D.) L[-10]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q36. मान िीजिए डक list1 = [3, 4, 5, 20, 5, 25, 1, 3] है, list1 को रन करने के बाि आउटपुट
क्या होगा?
Suppose list1 = [3, 4, 5, 20, 5, 25, 1, 3], what will be list1 after running the
code?

(A.) [3, 4, 5, 20, 5, 25, 1, 3]


(B.) [3, 4, 5, 20]
(C.) [3, 4, 5, 5, 25, 1, 3]
(D.) [3, 4, 20, 5, 25, 1, 3]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q37. डनम्नलिखित पायथन कोि मान्य है?
Is the following Python code valid?

a, b, c = 1, 2, 3
print(a, b, c)

(A.) Yes, {1, 2, 3} is printed


(B.) No, invalid syntax
(C.) Yes, (1, 2, 3) is printed
(D.) 1 is printed

Contact Us
JOIN US ON for Free Course +91-9027902171
Q38. डनम्नलिखित पायथन कोि मान्य है?
Is the following Python code valid?

a = 2, 3, 4, 5
print(a)

(A.) Yes, 2 is printed


(B.) Yes, [2, 3, 4, 5] is printed
(C.) No, too many values to unpack
(D.) Yes, (2, 3, 4, 5) is printed

Contact Us
JOIN US ON for Free Course +91-9027902171
Q39. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = (2, 3, 1, 5)
a.sort()
print(a)

(A.) (1, 2, 3, 5)
(B.) (2, 3, 1, 5)
(C.) None
(D.) Error, tuple has no attribute sort

Contact Us
JOIN US ON for Free Course +91-9027902171
Q40. डनम्नलिखित कोि का आउटपुट क्या होगा?
What will be the output of the following code?

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

(A.) (3,)
(B.) (2,)
(C.) (1,)
(D.) (0,)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q41. लिस्ट को टपि में बििें।
Convert a list into tuple.
(a) tuple(seq)
(b) list(tuple)
(c) tuple * list
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q42. स्पष्ट रूप से एक स़ंपूर्ण टपि हटा िें।
Explicitly remove an entire tuple.
(a) del
(b) remove
(c) pop
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q43. टपल्स और सूजचयों के बीच अ़ं तर यह है डक टपल्स को बििा नहीं िा सकता है िबडक
सूजचयाुँ बििी िा सकती हैं और टपल्स …………… का उपयोग करते हैं, िबडक सूजचयाुँ
स्क्वायर ब्रैकेट का उपयोग करती हैं।
The difference between tuples and lists are, the tuples cannot be changed
unlike lists and tuples use ……………., whereas lists use square brackets.

(a) parenthesis
(b) reference
(c) function
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q44. डनम्नलिखित में से कौन सा कथन एक डिक्शनरी बनाता है?
Which of the following statements create a dictionary?
(a) d = {}
(b) d = {"john":40, "peter":45}
(c) d = {40:"john", 45:"peter"}
(d) All of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q45. कौन सा कथन सही है?
Which statement is correct?

(A.) List is mutable & Tuple is immutable.


(B.) List is immutable & Tuple is mutable.
(C.) Both List and Tuple are Mutable.
(D.) Both List and Tuple are Immutable.

Contact Us
JOIN US ON for Free Course +91-9027902171
Q46. डकसी लिस्ट में कोई मान मौिूि है या नहीं इसकी िाुँच करने का डनम्नलिखित में से कौन सा
सही तरीका है?
Which of the following is the correct way to check if a value exists in a list?

(A.) list.contains(value)
(B.) list.index(value)
(C.) list.contains(value)
(D.) value in list

Contact Us
JOIN US ON for Free Course +91-9027902171
Q47. लिस्ट पररवतणनशीि है और टपि अपररवतणनीय है?
List is mutable and Tuple is immutable?

(A.) Yes, list mutable and tuple immutable


(B.) No, list and tuple both are mutable
(C.) No, list and tuple both are immutable
(D.) No, just opposite, list immutable and tuple mutable

Contact Us
JOIN US ON for Free Course +91-9027902171
Q48. इनमें से कौन सा तबल्ट इन फ़ंक्शन नहीं है?
Which one is not a built-in function?
(A.) dictionary()
(B.) set()
(C.) tuple()
(D.) list()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q49. डकस प्रकार का िेटा है: arr=[(1,1),(2,2),(3,3)]?
What type of data is: arr=[(1,1),(2,2),(3,3)]?

(A.) List of tuple


(B.) Tuple of List
(C.) Array of Tuples
(D.) Invalid Type

Contact Us
JOIN US ON for Free Course +91-9027902171
Q50. पायथन में टपि बनाने का डनम्नलिखित में से कौन सा सही तरीका है?
Which of the following is a correct way to create a tuple in Python?

(A.) tuple1 = [1, 2, 3]


(B.) tuple1 = {1, 2, 3}
(C.) tuple1 = (1, 2, 3)
(D.) tuple1 = (1, 2, 3,)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q51. आप सूची के अ़ं त में '4' तत्व 'my_list = [1, 2, 3]' कैसे िोड़ सकते हैं?
How can you add an element '4' to the end of the list my_list = [1, 2, 3]?

(A.) my_list.append(4)
(B.) my_list.add(4)
(C.) my_list.insert(4)
(D.) my_list.extend(4)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q52. शब्दकोश student = {"name": "John", "age": 21, "course": "Math"} को िेिते
हए, आप कु़ंिी "age" से िुड़े मूल्य तक कैसे पह़ंच सकते हैं?
Given the dictionary student = {"name": "John", "age": 21, "course": "Math"},
how can you access the value associated with the key "age"?

(A.) student.get("age")
(B.) student["age"]
(C.) student.age
(D.) Both (A) and (B)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q53. पाइथन में टपि को अपररवतणनीय क्यों माना िाता है?
Why are tuples considered immutable in Python?

(A.) Because their elements can be changed


(B.) Because their elements cannot be changed
(C.) Because they are stored in a different way than lists
(D.) Because they consume more memory

Contact Us
JOIN US ON for Free Course +91-9027902171
Q54. 1 से 5 तक की स़ंख्याओ ़ं के वगों की सूची बनाने के लिए डनम्नलिखित में से कौन सी सही
सूची समझ है?
Which of the following is a correct list comprehension to create a list of
squares of numbers from 1 to 5?

(A.) [x * x for x in range(1, 6)]


(B.) [x 2 for x in range(1, 5)]
(C.) [x * x for x in range(1, 5)]
(D.) [x ^ 2 for x in range(1, 6)]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q55. शब्दकोश से कु़ंिी-मूल्य िोड़ी को हटाने के लिए डनम्नलिखित में से डकस तवति का उपयोग
डकया िा सकता है?
Which of the following methods can be used to remove a key-value pair
from a dictionary?
(A.) pop()
(B.) remove()
(C.) delete()
(D.) discard()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q56. values() डिक्शनरी का एक फ़ंक्शन है िो डिक्शनरी से सभी वैल्यू प्राप्त करता है।
values() is a function of a dictionary that gets all the values from the
dictionary.

(a) True
(b) False
(c) can’t say
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q57. पाइथन में frozenset(s) फ़ंक्शन है िो टपल्स के सीक्वेंस को डिक्शनरी में पररवतति त
करता है।
frozenset(s) function converts a sequence of tuples to dictionary in Python.

(a) True
(b) False
(c) can’t say
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q58. पाइथन में एक फ़ंक्शन िो एक स्ट्ऱंग को एक लिस्ट में पररवतति त करता है:
A function converts a string to a list in Python.

(a) list()
(b) filter()
(c) tuple()
(d) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q59. डनम्न में से कौन शब्दकोश में key = "tiger" के लिए कु़ंिी-मूल्य िोड़ी को हटा िेगा?
Which of the following will delete the key-value pair for key="tiger" in a
dictionary?

(a) del dic["tiger"]


(b) dic["tiger"].delete()
(c) delete(dic.["tiger"])
(d) del(dic.["tiger"])

Contact Us
JOIN US ON for Free Course +91-9027902171
Q60. नीचे िी गई ऑब्जेक्ट डकस िेटा टाइप की है?
What data type is the object below?

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


(A.) List
(B.) Dictionary
(C.) Tuple
(D.) Array

Contact Us
JOIN US ON for Free Course +91-9027902171
Q61. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
z = set('abc')
z.add('san')
z.update(set(['p', 'q']))

(A.) {'abc', 'p', 'q', 'san'}


(B.) {'a', 'b', 'c', ['p', 'q'], 'san'}
(C.) {'a', 'c', 'c', 'p', 'q', 's', 'a', 'n'}
(D.) {'a', 'b', 'c', 'p', 'q', 'san'}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q62. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

{a 2 for a in range(4)}

(A.) {1, 4, 9, 16}


(B.) {0, 1, 4, 9, 16}
(C.) Error
(D.) {0, 1, 4, 9}

Contact Us
JOIN US ON for Free Course +91-9027902171
Q63. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

s1 = {3, 4} (A.) {(3, 4), (1, 2)}


s2 = {1, 2} (B.) Error
s3 = set() (C.) {(4, 2), (3, 1), (4, 1), (5, 2)}
for i in s1: (D.) {(3, 1), (4, 2)}
for j in s2:
s3.add((i, j))
print(s3)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q64. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = {}
a['a'] = 1
a['b'] = [2, 3, 4]
print(a)

(A.) Exception is thrown


(B.) {'b': [2], 'a': 1}
(C.) {'b': [2], 'a': [3]}
(D.) {'a': 1, 'b': [2, 3, 4]}
Contact Us
JOIN US ON for Free Course +91-9027902171
Q65. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
count = {}
count[(1, 2, 4)] = 5 (A.) 25
count[(4, 2, 1)] = 7 (B.) 17
count[(1, 2)] = 6 (C.) 16
count[(4, 2, 1)] = 2 (D.) Tuples can't be made keys
tot = 0 of a dictionary
for i in count:
tot = tot + count[i]
print(len(count) + tot)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q66. list1 में एक element(5) िोड़ने के लिए डकस फ़ंक्शन का उपयोग डकया िाता है?
Which function is used to add an element (5) in list1?

(A.) list1.sum(5)
(B.) list1.add(5)
(C.) list1.append(5)
(D.) list1.addelement(5)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q67. की-वैल्यू पेअर होता है ............ में।
Key-value pair exists in ............

(A.) list
(B.) set
(C.) tuple
(D.) dictionary

Contact Us
JOIN US ON for Free Course +91-9027902171
Q68. __________ ऑपरेटर दिए गए आइटम्स की स़ंख्या के लिए एक सूची को िोहराता है।
__________ operator repeats a list for the given number of items.

(A.) pow
(B.) *
(C.) repeat
(D.) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q69. डनम्नलिखित पायथन कोि का आउटपुट क्या है?
What is the output of the following Python code?

tuple1 = (5, 1, 7, 6, 2)
tuple1.pop(2)
print(tuple1)

(A.) (5, 1, 6, 2)
(B.) (5, 1, 7, 6)
(C.) (5, 1, 7, 6, 2)
(D.) Error
Contact Us
JOIN US ON for Free Course +91-9027902171
Q70. िब हम list("hello") डनष्पादित करते हैं तो आउटपुट क्या होता है?
What is the output when we execute list("hello")?

(A.) ['h', 'e', 'l', 'l', 'o']


(B.) [' hello']
(C.) ['llo']
(D.) ['olleh']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q71. What will be the output of the following Python code?

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

(A) [2, 3, 4]
(B) 3
(C) 2
(D) An exception is thrown

Contact Us
JOIN US ON for Free Course +91-9027902171
Q72. What will be the output of the following Python code?
a = {'B': 5, 'A': 9, 'C': 7}
print(sorted(a))

(A) ['A', 'B', 'C']


(B) ['B', 'C', 'A']
(C) [5, 7, 9]
(D) [9, 5, 7]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q73. What will be the output of the following Python code?

matrix = [[1, 2], [3, 4], [5, 6]]


t_matrix = [[row[i] for row in matrix] for i in range(2)]
print(t_matrix)

(A) [[1, 3, 5], [2, 4, 6]]


(B) [[1, 2], [3, 4], [5, 6]]
(C) [[1, 2, 3], [4, 5, 6]]
(D) [[1, 4, 6], [2, 3, 5]]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q74. What will be the output of the following Python code?

a = dict()
a[1]
(A) An exception is thrown since the dictionary is empty
(B) ' '
(C) 1
(D) 0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q75. The data structure which is a mutable ordered sequence of elements is
called:
िेटा ्रक्चर िो एलिमेंट्स का एक म्यूटब
े ि ऑिणिण सीक्वेंस है, क्या कहिाता है?

(A) Built-in
(B) List
(C) Tuple
(D) Derived data

Contact Us
JOIN US ON for Free Course +91-9027902171
Q76. Which one of the following is an immutable data type?
डनम्नलिखित में से कौन-सा अपररवतणनीय िेटा प्रकार है?

(A) list
(B) set
(C) tuple
(D) dict

Contact Us
JOIN US ON for Free Course +91-9027902171
Q77. What type of data is the following?
arr = [(1, 1), (2, 2), (3, 3)]

(A) List of tuples


(B) Tuples of lists
(C) Array of tuples
(D) Invalid type

Contact Us
JOIN US ON for Free Course +91-9027902171
Q78. In which data type, indexing is not valid?
डकस िेटा प्रकार में इ़ं िेक्क्सिं ग मान्य नहीं है?

(A) list
(B) dictionary
(C) string
(D) none of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q79. What is the output of the following code?

a = set('abc')
b = set('cd')
print(a ^ b)

(A) {'a', 'b', 'c', 'd'}


(B) {'c', 'b', 'a', 'd'}
(C) {'b', 'a', 'd'}
(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q80. Suppose a tuple arr contains 10 elements. How can you set the 5th
element of the tuple to 'Hello'?
मान िीजिए एक tuple arr में 10 एलिमेंट्स हैं। आप टपि के 5वें एलिमेंट को 'Hello' से कैसे
सेट कर सकते हैं?

(A) arr[4] = 'Hello'


(B) arr(4) = 'Hello'
(C) Elements of tuple cannot be changed
(D) arr[5] = 'Hello'

Contact Us
JOIN US ON for Free Course +91-9027902171
Q81. A sequence of immutable objects is called:
अपररवतणनीय वस्तुओ ़ं का अनुक्रम क्या कहिाता है?

(A) Built in
(B) List
(C) Tuple
(D) Derived data

Contact Us
JOIN US ON for Free Course +91-9027902171
Q82. Which of the following is a compound structure?
डनम्नलिखित में से कौन एक क़ंपाउ़ं ि ्रक्चर है?

(A) Pair
(B) Triplet
(C) Single
(D) Quadrat

Contact Us
JOIN US ON for Free Course +91-9027902171
Q83. Bundling two values together into one can be considered as:
िो मानों को एक साथ िोड़ना क्या कहिाता है?

(A) Pair
(B) Triplet
(C) Single
(D) Quadrat

Contact Us
JOIN US ON for Free Course +91-9027902171
Q84. Which of the following is constructed by placing expressions within
square brackets?
डनम्नलिखित में से कौन सा वगीकन, कोष्ठकों के भीतर एक्सप्रेशन रिकर बनता है?

(A) Tuples
(B) Lists
(C) Classes
(D) Quadrats

Contact Us
JOIN US ON for Free Course +91-9027902171
Q85. What will be the output of the following Python code?
डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
l = [x for x in range(10) if x % 2 != 0]
print(l)

(A) [1, 2, 3, 4, 5, 6, 7, 8, 9]
(B) [0, 2, 4, 6, 8]
(C) [1, 3, 5, 7, 9]
(D) [1, 3, 5, 7, 9, 11]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q86. What is the output of the following code?
डनम्नलिखित कोि का आउटपुट क्या है?
a1 = {1: "A", 2: "B", 3: "C"}
b1 = {4: "D", 5: "E"}
b1.update(a1)
print(b1)

(A) {4: "D", 5: "E", 1: "A", 2: "B", 3: "C"}


(B) {1: "A", 2: "B", 3: "C", 4: "D", 5: "E"}
(C) {4: "D", 5: "E"}
(D) None of these
Contact Us
JOIN US ON for Free Course +91-9027902171
Q87. What is the output of the following code?
डनम्नलिखित कोि का आउटपुट क्या है?

A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]


print(A[1][:])

(A) [1, 2, 3]
(B) [4, 5, 6]
(C) [2, 5, 8]
(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q88. What is the output of the following code?
डनम्नलिखित कोि का आउटपुट क्या है?

t = (2, 3, 4, 3.5, 5, 6)
print(sum(t) + t.count(2))

(A) 24
(B) 23.5
(C) 24.5
(D) 25.5

Contact Us
JOIN US ON for Free Course +91-9027902171
Q89. Suppose d = {“john”: 40, “peter”: 45}, to delete the entry for “john”
what command do we use?
मान िीजिए d = {"िॉन": 40, "पीटर": 45}, "john" के ए़ं री को हटाने के लिए हम डकस कमा़ंि
का उपयोग करते हैं?

(A) d.delete("john": 40)


(B) d.delete("john")
(C) del d["john"]
(D) del d("john": 40)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q90. How to copy one list to another in Python?
पायथन में एक सूची को िूसरे में कैसे कॉपी करें?

(A) a1 = list(a2)
(B) a1 = a2.copy()
(C) a1 = a2[:]
(D) All of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q91. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]


[A[row][2] for row in (0, 1, 2)]

(A.) [3, 6, 9]
(B.) [1, 4, 7]
(C.) [7, 8, 9]
(D.) [1, 2, 3]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q92. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

lst=[3,4,6,1,2]
lst[2:4]=[9,10]
print(lst)

(A.) [3, 4, 9, 10, 1, 2]


(B.) [3, 4, 9, 10, 2]
(C.) [3, 4, 6, 9, 10, 2]
(D.) [3, 4, 9, 10, 6, 1, 2]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q93. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?

lst=[3,4,6,1,2]
lst[3:5]=[7,8]
print(lst)

(A.) [3, 4, 7, 8]
(B.) [3, 4, 6, 7, 8, 2]
(C.) [3, 4, 6, 7, 8,4]
(D.) [3, 4, 6, 7, 8, 1, 2]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q94. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = [1, 2, 3]
b = a.append(4)
print(a)
print(b)

(A.) [1, 2, 3, 4] [1, 2, 3, 4]


(B.) [1, 2, 3, 4] None
(C.) Syntax error
(D.) [1, 2, 3] [1, 2, 3, 4]
Contact Us
JOIN US ON for Free Course +91-9027902171
Q95. डनम्नलिखित पायथन कोि का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = [13, 56, 17]
a.append([87])
a.extend([45, 67])
print(a)

(A.) [13, 56, 17, [87], 45, 67]


(B.) [13, 56, 17, 87, 45, 67]
(C.) [13, 56, 17, 87, [45, 67]]
(D.) [13, 56, 17, [87], [45, 67]]
Contact Us
JOIN US ON for Free Course +91-9027902171
Q96. डनम्नलिखित कोि का आउटपुट क्या है?
What is the output of the following code?

dict={"Joey":1, "Rachel":2}
dict.update({"Phoebe":2})
print(dict)

(A.) {'Joey': 1, 'Rachel': 2, 'Phoebe': 2}


(B.) {"Joey":1, "Rachel":}
(C.) {"Joey":1, "Phoebe":2}
(D.) Error
Contact Us
JOIN US ON for Free Course +91-9027902171
Q97. lstrip() मेथि का उपयोग डकसलिए डकया िाता है?
lstrip() method is used for:

(A.) Delete all the trailing whitespace characters


(B.) Delete all the leading whitespace characters
(C.) Delete all the leading and trailing whitespace characters
(D.) Delete upper case characters

Contact Us
JOIN US ON for Free Course +91-9027902171
Q98. डनम्नलिखित कोि का आउटपुट क्या है?
What is the output of the following code?

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

(A.) {'d', 'c', 'm', 'l', 'p', 'c'}


(B.) {'m', 'l', 'p', 'c'}
(C.) {'d', 'c', 'm', 'a'}
(D.) None of These

Contact Us
JOIN US ON for Free Course +91-9027902171
Q99. डनम्नलिखित का आउटपुट क्या होगा?
What will be the output of the following?

print(range(4))

(A.) 0,1,2,3
(B.) [0,1,2,3]
(C.) range(0, 4)
(D.) (0,1,2,3)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q100. डनम्नलिखित कोि का आउटपुट क्या है?
What is the output of the following code?

ms = ('A','D', 'H','U','N','I','C')
print(ms[1:4])

(A.) (‘D’, ‘H’, ‘U’)


(B.) (‘A’, ‘D’, ‘H’, ‘U’, ‘N’, ‘I’, ‘C’)
(C.) (‘D’,’H’,’U’,’N’,’I’,’C’)
(D.) (‘D’,’H’,’U’,’N’,’I’,’C’)

Contact Us
JOIN US ON for Free Course +91-9027902171
THaNK You!
Contact Us
JOIN US ON for Free Course +91-9027902171

You might also like