Font size
WorksheetsPython MCQs: Sequence Data Types chapter 5
Total questions: 103
Worksheet time: 52mins
What are sequence data types in Python?
They are used to store multiple items in a single variable.
Examples include lists, tuples, and strings.
Sequence types support indexing and slicing.
All of the above.
निम्नलिखित में से कौन सा Python का Sequence Data Type नहीं है?
List
Tuple
Dictionary
String
How is a list created in Python?
By using:
Curly braces
Square brackets
Parentheses
Quotes
सूची में तत्व कैसे जोड़ सकते हैं?
append()
insert()
extend()
सभी
What will be the output of the code list1 = [10, 20, 30]; print(list1[1])?
10
20
30
Error
यदि हम सूची के तत्व list1[5] को एक्सेस करते हैं, और सूची में केवल 4 तत्व हैं, तो क्या होगा?
IndexError
0
Null
कोई त्रुटि नहीं होगी
Which method adds an element at the end of a list?
append()
extend()
insert()
add()
list1 = [1, 2, 3]; list1.insert(1, 10) का आउटपुट क्या होगा?
[1, 10, 2, 3]
[1, 2, 10, 3]
[10, 1, 2, 3]
त्रुटि
What does the remove() method do?
All occurrences of an element
The first occurrence of an element
An element at a specific index
An element randomly
list1.pop() में क्या होता है?
लिस्ट का पहला तत्व हटाया जाता है।
लिस्ट का आखिरी तत्व हटाया जाता है।
त्रुटि होती है।
कोई कार्रवाई नहीं होती।
Which method is used to sort a list in Python?
sort()
order()
arrange()
sequence()
reverse() विधि सूची को किस क्रम में बदलती है?
आरोही
अवरोही
उल्टा क्रम
यादृच्छिक क्रम
What is aliasing in Python?
Making a new copy of the list
Creating a reference to the original list
Changing the list elements
Sorting the list
यदि हम सूची की गहरी कॉपी बनाना चाहते हैं, तो हमें कौन सा तरीका उपयोग करना चाहिए?
copy()
deepcopy()
clone()
None
What is a nested list?
With only integers
Inside another list
With unique elements
With no elements
निम्नलिखित में से कौन nested list के लिए सत्य है?
सूची में सूची संग्रहीत की जा सकती है।
सभी तत्व एक ही प्रकार के होने चाहिए।
इसमें केवल संख्यात्मक मान हो सकते हैं।
यह Python में समर्थित नहीं है।
Which of the following is not a property of a tuple?
Immutable
Ordered
Mutable
Supports indexing
ट्यूपल बनाने के लिए कौन सा सिंटैक्स उपयोग किया जाता है?
[]
()
{}
<>
How is a dictionary defined in Python?
Square brackets
Parentheses
Curly braces
None
डिक्शनरी में तत्व कैसे एक्सेस किए जाते हैं?
कुंजी के माध्यम से
अनुक्रमण द्वारा
दोनों
इनमें से कोई नहीं
What does slicing in a list return?
New list
Tuple
Original list
Error
Q21. What does slicing in a list return?
New list
Tuple
Original list
Error
Q22. सूची में अनुक्रमण किसके लिए उपयोग किया जाता है?
तत्वों को एक्सेस करने के लिए
सूची को जोड़ने के लिए
तत्व हटाने के लिए
तत्वों को पुनः व्यवस्थित करने के लिए
Q23. Which function is used to find the smallest element in a list?
min()
smallest()
find_min()
None
Q24. max() फ़ंक्शन का उपयोग कब किया जाता है?
सबसे छोटे तत्व को खोजने के लिए
सबसे बड़े तत्व को खोजने के लिए
सभी तत्वों को जोड़ने के लिए
इनमें से कोई नहीं
Q25. What will be the output of the code below?
list1 = [1, 2, 3]
list2 = list1 * 2
print(list2)
[1, 2, 3, 1, 2, 3]
[1, 2, 3, 2, 3]
[2, 4, 6]
Error
Q26. निम्नलिखित में से कौन सा सूची से सभी तत्वों को हटाने के लिए उपयोग किया जाता है?
remove()
clear()
del list
None
Q27. What is tuple unpacking in Python?
Assigning elements of a tuple to multiple variables.
Converting a tuple into a list.
Adding elements to a tuple.
Sorting a tuple.
Q28. ट्यूपल पैकिंग का क्या अर्थ है?
सूची को ट्यूपल में परिवर्तित करना।
विभिन्न मानों को एक ट्यूपल में जोड़ना।
ट्यूपल को स्ट्रिंग में परिवर्तित करना।
ट्यूपल को डिक्शनरी में बदलना।
Q29. How can you create an empty dictionary?
dict()
{}
Both 1 and 2
None of the above
Q30. डिक्शनरी में कौन सा डाटा प्रकार कुंजी के रूप में उपयोग नहीं किया जा सकता?
स्ट्रिंग
सूची
ट्यूपल
पूर्णांक (Integer)
Q31. What will be the result of slicing the list [1, 2, 3, 4][1:3]?
[2, 3]
[1, 2]
[3, 4]
Error
Q32. list1 = [10, 20, 30, 40] और list1[-1] का आउटपुट क्या होगा?
10
20
40
Error
Q33. How can two lists be concatenated?
Using the + operator
Using the * operator
Using the & operator
Lists cannot be concatenated
Q34. निम्नलिखित ऑपरेशन के लिए सही आउटपुट क्या है?
list1 = [1, 2]
list2 = [3, 4]
result = list1 + list2
print(result)
[1, 2, 3, 4]
[3, 4, 1, 2]
त्रुटि (Error)
[1, 2]
Q35. What will min([4, 2, 8, 1]) return?
8
2
4
1
Q36. निम्न कोड का आउटपुट क्या होगा?
max([-10, -20, 0, 5])
-20
-10
5
0
Q37. How can you access the value 3 in the list [[1, 2], [3, 4]]?
list[1][0]
list[0][1]
list[1][1]
list[0][0]
Q38. क्या सूची में सूची को म्यूटेबल (Mutable) माना जाता है?
हां
नहीं
Q39. Which operation is not allowed on a tuple?
Concatenation
Slicing
Indexing
Updating an element
Q40. ट्यूपल का प्रमुख लाभ क्या है?
यह म्यूटेबल है।
इसमें अधिक स्थान लेता है।
यह इम्म्यूटेबल है।
इसे क्रमबद्ध नहीं किया जा सकता।
Q41. What is the output of the following code?
list1 = [x for x in range(5)]
print(list1)
[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
[5, 4, 3, 2, 1]
Error
What is the output of the following code? list1 = [x for x in range(5)] print(list1)
[0, 1, 2, 3, 4]
[1, 2, 3, 4, 5]
[5, 4, 3, 2, 1]
Error
निम्नलिखित कोड का आउटपुट क्या होगा? list1 = [x**2 for x in range(3)] print(list1)
[0, 1, 4]
[1, 4, 9]
[0, 1, 2]
त्रुटि
What does the keys() method of a dictionary return?
A list of all values
A list of all keys
A list of all key-value pairs
None of the above
डिक्शनरी के items() विधि का आउटपुट क्या होता है?
सभी कुंजियों की सूची
सभी मानों की सूची
कुंजी-मूल्य जोड़े के ट्यूपल
त्रुटि
Which of the following is true for lists and tuples?
Lists are immutable, tuples are mutable.
Tuples are immutable, lists are mutable.
Both are immutable.
Both are mutable.
ट्यूपल को सूची में परिवर्तित करने के लिए किस विधि का उपयोग किया जा सकता है?
tuple()
list()
convert()
change()
What is the output of the code below? dict1 = {"A": {"B": 2, "C": 3}} print(dict1["A"]["B"])
{"B": 2, "C": 3}
2
3
Error
क्या डिक्शनरी को एक डिक्शनरी के अंदर नेस्ट किया जा सकता है?
हां
नहीं
What is the output of the following code? t = (1, 2, 3) a, b, c = t print(b)
1
2
3
Error
निम्नलिखित कोड का उद्देश्य क्या है? t = (1, 2, 3) a, b, c = t
ट्यूपल को सूची में परिवर्तित करना।
ट्यूपल को अनपैक करना।
ट्यूपल को एक डिक्शनरी में परिवर्तित करना।
ट्यूपल का गहरा कॉपी बनाना।
Which of the following can not be used as a key in a dictionary?
Integer
Tuple
List
String
डिक्शनरी में कुंजी के रूप में किसका उपयोग किया जा सकता है?
अपरिवर्तनीय (Immutable) डेटा प्रकार
म्यूटेबल (Mutable) डेटा प्रकार
दोनों
इनमें से कोई नहीं
What will len([1, 2, 3, 4]) return?
4
3
5
Error
निम्नलिखित कोड का आउटपुट क्या होगा? list1 = [5, 10, 15, 20] print(sum(list1))
15
20
50
Error
Which operation is allowed on tuples?
Indexing
Slicing
Concatenation
All of the above
ट्यूपल में तत्वों को कैसे एक्सेस किया जाता है?
अनुक्रमण द्वारा
कुंजी द्वारा
दोनों
इनमें से कोई नहीं
What will list1.index(20) return for list1 = [10, 20, 30]?
0
1
2
Error
क्या in ऑपरेटर का उपयोग सूची में किसी तत्व की उपस्थिति की जांच के लिए किया जा सकता है?
हां
नहीं
What is the output of the following code? nested_list = [[1, 2], [3, [4, 5]]] print(nested_list[1][1][0])
3
4
5
Error
निम्नलिखित में से कौन सा गहराई से नेस्टेड सूची के लिए सत्य है?
इसे इंडेक्सिंग द्वारा एक्सेस किया जा सकता है।
इसे क्रमबद्ध नहीं किया जा सकता।
इसे कॉपी किया जा सकता है।
सभी सही हैं।
What is the output of the following code? list1 = [1, 2, 3] list1.append(4) print(list1)
[1, 2, 3]
[1, 2, 3, 4]
[4, 1, 2, 3]
Error
What is the output of the following code? list1 = [1, 2, 3] list1.append(4) print(list1)
[1, 2, 3]
[1, 2, 3, 4]
[4, 1, 2, 3]
Error
सूची में एक से अधिक तत्व जोड़ने के लिए कौन सी विधि उपयोगी है?
append()
extend()
insert()
None of the above
What will the following code output? list1 = [1, 2, 3, 4] list1.remove(3) print(list1)
[1, 2, 3, 4]
[1, 2, 4]
[3, 4]
Error
पॉप() विधि का उपयोग किस लिए किया जाता है?
सूची से अंतिम तत्व को हटाने के लिए
सूची में तत्व जोड़ने के लिए
सूची को क्रमबद्ध करने के लिए
सूची से कोई भी तत्व हटाने के लिए
Which method can be used to create a copy of a list?
list.copy()
list[:]
copy.deepcopy()
All of the above
निम्नलिखित में से कौन सा सूची की गहरी प्रतिलिपि (deep copy) बनाता है?
list.copy()
copy.deepcopy()
list[:]
None of the above
What happens when you assign one list to another? list1 = [1, 2, 3] list2 = list1 list2.append(4) print(list1)
[1, 2, 3]
[1, 2, 3, 4]
Error
None of the above
एलियासिंग का अर्थ क्या है?
नई सूची बनाना
एक सूची का संदर्भ दूसरे नाम से बनाना
सूची को गहरा कॉपी करना
सूची से तत्व हटाना
Can a tuple contain another tuple?
Yes
No
नेस्टेड ट्यूपल में तत्वों को एक्सेस करने का तरीका क्या है?
अनुक्रमण (Indexing)
कुंजियों (Keys) द्वारा
slicing
दोनों 1 और 3
What will list(dict1.values()) return for dict1 = {"a": 1, "b": 2}?
["a", "b"]
[1, 2]
[("a", 1), ("b", 2)]
Error
डिक्शनरी में values() विधि का उपयोग किस लिए किया जाता है?
कुंजी सूची प्राप्त करने के लिए
मानों की सूची प्राप्त करने के लिए
कुंजी-मूल्य जोड़े को जोड़ने के लिए
डिक्शनरी को साफ़ करने के लिए
What will max((1, 5, 3)) return?
1
3
5
Error
ट्यूपल (10, 20, 5) में न्यूनतम मान क्या होगा?
10
20
5
Error
What happens if a non-existent key is accessed in a dictionary?
Error
None
Returns False
Returns an empty string
डिक्शनरी के तत्वों को कुंजियों का उपयोग करके कैसे एक्सेस किया जाता है?
अनुक्रमण (Indexing) द्वारा
कुंजियों (Keys) द्वारा
slicing द्वारा
इनमें से कोई नहीं
Which of the following is immutable?
List
Dictionary
Tuple
Set
सूची को अपरिवर्तनीय (Immutable) बनाने का तरीका क्या है?
इसे एक ट्यूपल में बदलें।
इसे कॉपी करें।
इसे खाली करें।
यह संभव नहीं है।
What will the output of this code be? list1 = [1, 2] dict1 = {3: list1} dict1[3].append(4) print(dict1)
{3: [1, 2]}
{3: [1, 2, 4]}
{3: [4]}
Error
क्या सूची को डिक्शनरी में मान के रूप में उपयोग किया जा सकता है?
हां
नहीं
What is Tuple Packing?
Creating a tuple by grouping values together
Extracting values from a tuple
Adding elements to a tuple
Removing elements from a tuple
निम्नलिखित में से कौन सा ट्यूपल पैकिंग का एक उदाहरण है?
t = 1, 2, 3
t = (1, 2, 3)
दोनों
इनमें से कोई नहीं
What is the output of the following code?
nested_list = [[1, 2], [3, [4, 5]]]
print(nested_list[1][1][0])
3
4
5
Error
ट्यूपल अनपैकिंग कब संभव है?
जब तत्वों की संख्या मेल खाती हो।
जब तत्वों की संख्या कम हो।
हमेशा संभव है।
इनमें से कोई नहीं।
What does the following code output?
list1 = [1, 2]
list2 = [3, 4]
print(list1 + list2)
[1, 2, 3, 4]
[1, 2, [3, 4]]
Error
None of the above
क्या सूची के टुकड़े जोड़ने के लिए + ऑपरेटर का उपयोग किया जा सकता है?
हां
नहीं
Can a tuple be used as a key in a dictionary?
Yes, if it contains only immutable elements.
Yes, always.
No, never.
None of the above
क्या डिक्शनरी में म्यूटेबल तत्व कुंजी के रूप में उपयोग किए जा सकते हैं?
हां
नहीं
What does the sort() method do?
Sorts the list in ascending order
Sorts the list in descending order
Both depending on the parameter
None of the above
निम्नलिखित कोड का आउटपुट क्या होगा?
निम्नलिखित कोड का आउटपुट क्या होगा?
list1 = [3, 1, 2]
list1.sort(reverse=True)
print(list1)
[3, 2, 1]
[1, 2, 3]
[2, 3, 1]
त्रुटि
What will the output of this slicing operation be?
list1 = [10, 20, 30, 40]
print(list1[1:3])
[10, 20]
[20, 30]
[30, 40]
Error
क्या सूची का पूरा हिस्सा निकालने के लिए [:] का उपयोग किया जा सकता है?
हां
नहीं
What will len({"a": 1, "b": 2, "c": 3}) return?
3
6
2
Error
डिक्शनरी में कितने कुंजी-मूल्य जोड़े हैं, यह जानने के लिए कौन सी विधि उपयोगी है?
len()
keys()
items()
values()
What will the following code output?
nested_list = [[1, 2], [3, 4, 5]]
print(len(nested_list))
2
5
Error
None of the above
नेस्टेड सूचियों में तत्वों तक पहुँचने के लिए किसका उपयोग किया जाता है?
अनुक्रमण
कुंजियों का
slicing
इनमें से कोई नहीं
What will happen if we try to modify a tuple?
The tuple will be modified.
Error will occur.
It will create a new tuple.
None of the above
क्या ट्यूपल में तत्वों को बदलने की अनुमति है?
हां
नहीं
What is the output of the following code?
data = {"info": [10, 20, {"key": "value"}]}
print(data["info"][2]["key"])
value
key
{"key": "value"}
Error
क्या नेस्टेड डिक्शनरी में तत्वों को नेस्टेड इंडेक्सिंग द्वारा एक्सेस किया जा सकता है?
हां
नहीं
