wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python MCQs: Sequence Data Types chapter 5

Total questions: 103

Worksheet time: 52mins

Name
Class
Date
1.

What are sequence data types in Python?

a)

They are used to store multiple items in a single variable.

b)

Examples include lists, tuples, and strings.

c)

Sequence types support indexing and slicing.

d)

All of the above.

2.

निम्नलिखित में से कौन सा Python का Sequence Data Type नहीं है?

a)

List

b)

Tuple

c)

Dictionary

d)

String

3.

How is a list created in Python?

a)

By using:

b)

Curly braces

c)

Square brackets

d)

Parentheses

e)

Quotes

4.

सूची में तत्व कैसे जोड़ सकते हैं?

a)

append()

b)

insert()

c)

extend()

d)

सभी

5.

What will be the output of the code list1 = [10, 20, 30]; print(list1[1])?

a)

10

b)

20

c)

30

d)

Error

6.

यदि हम सूची के तत्व list1[5] को एक्सेस करते हैं, और सूची में केवल 4 तत्व हैं, तो क्या होगा?

a)

IndexError

b)

0

c)

Null

d)

कोई त्रुटि नहीं होगी

7.

Which method adds an element at the end of a list?

a)

append()

b)

extend()

c)

insert()

d)

add()

8.

list1 = [1, 2, 3]; list1.insert(1, 10) का आउटपुट क्या होगा?

a)

[1, 10, 2, 3]

b)

[1, 2, 10, 3]

c)

[10, 1, 2, 3]

d)

त्रुटि

9.

What does the remove() method do?

a)

All occurrences of an element

b)

The first occurrence of an element

c)

An element at a specific index

d)

An element randomly

10.

list1.pop() में क्या होता है?

a)

लिस्ट का पहला तत्व हटाया जाता है।

b)

लिस्ट का आखिरी तत्व हटाया जाता है।

c)

त्रुटि होती है।

d)

कोई कार्रवाई नहीं होती।

11.

Which method is used to sort a list in Python?

a)

sort()

b)

order()

c)

arrange()

d)

sequence()

12.

reverse() विधि सूची को किस क्रम में बदलती है?

a)

आरोही

b)

अवरोही

c)

उल्टा क्रम

d)

यादृच्छिक क्रम

13.

What is aliasing in Python?

a)

Making a new copy of the list

b)

Creating a reference to the original list

c)

Changing the list elements

d)

Sorting the list

14.

यदि हम सूची की गहरी कॉपी बनाना चाहते हैं, तो हमें कौन सा तरीका उपयोग करना चाहिए?

a)

copy()

b)

deepcopy()

c)

clone()

d)

None

15.

What is a nested list?

a)

With only integers

b)

Inside another list

c)

With unique elements

d)

With no elements

16.

निम्नलिखित में से कौन nested list के लिए सत्य है?

a)

सूची में सूची संग्रहीत की जा सकती है।

b)

सभी तत्व एक ही प्रकार के होने चाहिए।

c)

इसमें केवल संख्यात्मक मान हो सकते हैं।

d)

यह Python में समर्थित नहीं है।

17.

Which of the following is not a property of a tuple?

a)

Immutable

b)

Ordered

c)

Mutable

d)

Supports indexing

18.

ट्यूपल बनाने के लिए कौन सा सिंटैक्स उपयोग किया जाता है?

a)

[]

b)

()

c)

{}

d)

<>

19.

How is a dictionary defined in Python?

a)

Square brackets

b)

Parentheses

c)

Curly braces

d)

None

20.

डिक्शनरी में तत्व कैसे एक्सेस किए जाते हैं?

a)

कुंजी के माध्यम से

b)

अनुक्रमण द्वारा

c)

दोनों

d)

इनमें से कोई नहीं

21.

What does slicing in a list return?

a)

New list

b)

Tuple

c)

Original list

d)

Error

22.

Q21. What does slicing in a list return?

a)

New list

b)

Tuple

c)

Original list

d)

Error

23.

Q22. सूची में अनुक्रमण किसके लिए उपयोग किया जाता है?

a)

तत्वों को एक्सेस करने के लिए

b)

सूची को जोड़ने के लिए

c)

तत्व हटाने के लिए

d)

तत्वों को पुनः व्यवस्थित करने के लिए

24.

Q23. Which function is used to find the smallest element in a list?

a)

min()

b)

smallest()

c)

find_min()

d)

None

25.

Q24. max() फ़ंक्शन का उपयोग कब किया जाता है?

a)

सबसे छोटे तत्व को खोजने के लिए

b)

सबसे बड़े तत्व को खोजने के लिए

c)

सभी तत्वों को जोड़ने के लिए

d)

इनमें से कोई नहीं

26.

Q25. What will be the output of the code below?

list1 = [1, 2, 3] 

list2 = list1 * 2 

print(list2) 

a)

[1, 2, 3, 1, 2, 3]

b)

[1, 2, 3, 2, 3]

c)

[2, 4, 6]

d)

Error

27.

Q26. निम्नलिखित में से कौन सा सूची से सभी तत्वों को हटाने के लिए उपयोग किया जाता है?

a)

remove()

b)

clear()

c)

del list

d)

None

28.

Q27. What is tuple unpacking in Python?

a)

Assigning elements of a tuple to multiple variables.

b)

Converting a tuple into a list.

c)

Adding elements to a tuple.

d)

Sorting a tuple.

29.

Q28. ट्यूपल पैकिंग का क्या अर्थ है?

a)

सूची को ट्यूपल में परिवर्तित करना।

b)

विभिन्न मानों को एक ट्यूपल में जोड़ना।

c)

ट्यूपल को स्ट्रिंग में परिवर्तित करना।

d)

ट्यूपल को डिक्शनरी में बदलना।

30.

Q29. How can you create an empty dictionary?

a)

dict()

b)

{}

c)

Both 1 and 2

d)

None of the above

31.

Q30. डिक्शनरी में कौन सा डाटा प्रकार कुंजी के रूप में उपयोग नहीं किया जा सकता?

a)

स्ट्रिंग

b)

सूची

c)

ट्यूपल

d)

पूर्णांक (Integer)

32.

Q31. What will be the result of slicing the list [1, 2, 3, 4][1:3]?

a)

[2, 3]

b)

[1, 2]

c)

[3, 4]

d)

Error

33.

Q32. list1 = [10, 20, 30, 40] और list1[-1] का आउटपुट क्या होगा?

a)

10

b)

20

c)

40

d)

Error

34.

Q33. How can two lists be concatenated?

a)

Using the + operator

b)

Using the * operator

c)

Using the & operator

d)

Lists cannot be concatenated

35.

Q34. निम्नलिखित ऑपरेशन के लिए सही आउटपुट क्या है?

list1 = [1, 2] 

list2 = [3, 4] 

result = list1 + list2 

print(result) 

a)

[1, 2, 3, 4]

b)

[3, 4, 1, 2]

c)

त्रुटि (Error)

d)

[1, 2]

36.

Q35. What will min([4, 2, 8, 1]) return?

a)

8

b)

2

c)

4

d)

1

37.

Q36. निम्न कोड का आउटपुट क्या होगा?

max([-10, -20, 0, 5]) 

a)

-20

b)

-10

c)

5

d)

0

38.

Q37. How can you access the value 3 in the list [[1, 2], [3, 4]]?

a)

list[1][0]

b)

list[0][1]

c)

list[1][1]

d)

list[0][0]

39.

Q38. क्या सूची में सूची को म्यूटेबल (Mutable) माना जाता है?

a)

हां

b)

नहीं

40.

Q39. Which operation is not allowed on a tuple?

a)

Concatenation

b)

Slicing

c)

Indexing

d)

Updating an element

41.

Q40. ट्यूपल का प्रमुख लाभ क्या है?

a)

यह म्यूटेबल है।

b)

इसमें अधिक स्थान लेता है।

c)

यह इम्म्यूटेबल है।

d)

इसे क्रमबद्ध नहीं किया जा सकता।

42.

Q41. What is the output of the following code?

list1 = [x for x in range(5)] 

print(list1) 

a)

[0, 1, 2, 3, 4]

b)

[1, 2, 3, 4, 5]

c)

[5, 4, 3, 2, 1]

d)

Error

43.

What is the output of the following code? list1 = [x for x in range(5)] print(list1)

a)

[0, 1, 2, 3, 4]

b)

[1, 2, 3, 4, 5]

c)

[5, 4, 3, 2, 1]

d)

Error

44.

निम्नलिखित कोड का आउटपुट क्या होगा? list1 = [x**2 for x in range(3)] print(list1)

a)

[0, 1, 4]

b)

[1, 4, 9]

c)

[0, 1, 2]

d)

त्रुटि

45.

What does the keys() method of a dictionary return?

a)

A list of all values

b)

A list of all keys

c)

A list of all key-value pairs

d)

None of the above

46.

डिक्शनरी के items() विधि का आउटपुट क्या होता है?

a)

सभी कुंजियों की सूची

b)

सभी मानों की सूची

c)

कुंजी-मूल्य जोड़े के ट्यूपल

d)

त्रुटि

47.

Which of the following is true for lists and tuples?

a)

Lists are immutable, tuples are mutable.

b)

Tuples are immutable, lists are mutable.

c)

Both are immutable.

d)

Both are mutable.

48.

ट्यूपल को सूची में परिवर्तित करने के लिए किस विधि का उपयोग किया जा सकता है?

a)

tuple()

b)

list()

c)

convert()

d)

change()

49.

What is the output of the code below? dict1 = {"A": {"B": 2, "C": 3}} print(dict1["A"]["B"])

a)

{"B": 2, "C": 3}

b)

2

c)

3

d)

Error

50.

क्या डिक्शनरी को एक डिक्शनरी के अंदर नेस्ट किया जा सकता है?

a)

हां

b)

नहीं

51.

What is the output of the following code? t = (1, 2, 3) a, b, c = t print(b)

a)

1

b)

2

c)

3

d)

Error

52.

निम्नलिखित कोड का उद्देश्य क्या है? t = (1, 2, 3) a, b, c = t

a)

ट्यूपल को सूची में परिवर्तित करना।

b)

ट्यूपल को अनपैक करना।

c)

ट्यूपल को एक डिक्शनरी में परिवर्तित करना।

d)

ट्यूपल का गहरा कॉपी बनाना।

53.

Which of the following can not be used as a key in a dictionary?

a)

Integer

b)

Tuple

c)

List

d)

String

54.

डिक्शनरी में कुंजी के रूप में किसका उपयोग किया जा सकता है?

a)

अपरिवर्तनीय (Immutable) डेटा प्रकार

b)

म्यूटेबल (Mutable) डेटा प्रकार

c)

दोनों

d)

इनमें से कोई नहीं

55.

What will len([1, 2, 3, 4]) return?

a)

4

b)

3

c)

5

d)

Error

56.

निम्नलिखित कोड का आउटपुट क्या होगा? list1 = [5, 10, 15, 20] print(sum(list1))

a)

15

b)

20

c)

50

d)

Error

57.

Which operation is allowed on tuples?

a)

Indexing

b)

Slicing

c)

Concatenation

d)

All of the above

58.

ट्यूपल में तत्वों को कैसे एक्सेस किया जाता है?

a)

अनुक्रमण द्वारा

b)

कुंजी द्वारा

c)

दोनों

d)

इनमें से कोई नहीं

59.

What will list1.index(20) return for list1 = [10, 20, 30]?

a)

0

b)

1

c)

2

d)

Error

60.

क्या in ऑपरेटर का उपयोग सूची में किसी तत्व की उपस्थिति की जांच के लिए किया जा सकता है?

a)

हां

b)

नहीं

61.

What is the output of the following code? nested_list = [[1, 2], [3, [4, 5]]] print(nested_list[1][1][0])

a)

3

b)

4

c)

5

d)

Error

62.

निम्नलिखित में से कौन सा गहराई से नेस्टेड सूची के लिए सत्य है?

a)

इसे इंडेक्सिंग द्वारा एक्सेस किया जा सकता है।

b)

इसे क्रमबद्ध नहीं किया जा सकता।

c)

इसे कॉपी किया जा सकता है।

d)

सभी सही हैं।

63.

What is the output of the following code? list1 = [1, 2, 3] list1.append(4) print(list1)

a)

[1, 2, 3]

b)

[1, 2, 3, 4]

c)

[4, 1, 2, 3]

d)

Error

64.

What is the output of the following code? list1 = [1, 2, 3] list1.append(4) print(list1)

a)

[1, 2, 3]

b)

[1, 2, 3, 4]

c)

[4, 1, 2, 3]

d)

Error

65.

सूची में एक से अधिक तत्व जोड़ने के लिए कौन सी विधि उपयोगी है?

a)

append()

b)

extend()

c)

insert()

d)

None of the above

66.

What will the following code output? list1 = [1, 2, 3, 4] list1.remove(3) print(list1)

a)

[1, 2, 3, 4]

b)

[1, 2, 4]

c)

[3, 4]

d)

Error

67.

पॉप() विधि का उपयोग किस लिए किया जाता है?

a)

सूची से अंतिम तत्व को हटाने के लिए

b)

सूची में तत्व जोड़ने के लिए

c)

सूची को क्रमबद्ध करने के लिए

d)

सूची से कोई भी तत्व हटाने के लिए

68.

Which method can be used to create a copy of a list?

a)

list.copy()

b)

list[:]

c)

copy.deepcopy()

d)

All of the above

69.

निम्नलिखित में से कौन सा सूची की गहरी प्रतिलिपि (deep copy) बनाता है?

a)

list.copy()

b)

copy.deepcopy()

c)

list[:]

d)

None of the above

70.

What happens when you assign one list to another? list1 = [1, 2, 3] list2 = list1 list2.append(4) print(list1)

a)

[1, 2, 3]

b)

[1, 2, 3, 4]

c)

Error

d)

None of the above

71.

एलियासिंग का अर्थ क्या है?

a)

नई सूची बनाना

b)

एक सूची का संदर्भ दूसरे नाम से बनाना

c)

सूची को गहरा कॉपी करना

d)

सूची से तत्व हटाना

72.

Can a tuple contain another tuple?

a)

Yes

b)

No

73.

नेस्टेड ट्यूपल में तत्वों को एक्सेस करने का तरीका क्या है?

a)

अनुक्रमण (Indexing)

b)

कुंजियों (Keys) द्वारा

c)

slicing

d)

दोनों 1 और 3

74.

What will list(dict1.values()) return for dict1 = {"a": 1, "b": 2}?

a)

["a", "b"]

b)

[1, 2]

c)

[("a", 1), ("b", 2)]

d)

Error

75.

डिक्शनरी में values() विधि का उपयोग किस लिए किया जाता है?

a)

कुंजी सूची प्राप्त करने के लिए

b)

मानों की सूची प्राप्त करने के लिए

c)

कुंजी-मूल्य जोड़े को जोड़ने के लिए

d)

डिक्शनरी को साफ़ करने के लिए

76.

What will max((1, 5, 3)) return?

a)

1

b)

3

c)

5

d)

Error

77.

ट्यूपल (10, 20, 5) में न्यूनतम मान क्या होगा?

a)

10

b)

20

c)

5

d)

Error

78.

What happens if a non-existent key is accessed in a dictionary?

a)

Error

b)

None

c)

Returns False

d)

Returns an empty string

79.

डिक्शनरी के तत्वों को कुंजियों का उपयोग करके कैसे एक्सेस किया जाता है?

a)

अनुक्रमण (Indexing) द्वारा

b)

कुंजियों (Keys) द्वारा

c)

slicing द्वारा

d)

इनमें से कोई नहीं

80.

Which of the following is immutable?

a)

List

b)

Dictionary

c)

Tuple

d)

Set

81.

सूची को अपरिवर्तनीय (Immutable) बनाने का तरीका क्या है?

a)

इसे एक ट्यूपल में बदलें।

b)

इसे कॉपी करें।

c)

इसे खाली करें।

d)

यह संभव नहीं है।

82.

What will the output of this code be? list1 = [1, 2] dict1 = {3: list1} dict1[3].append(4) print(dict1)

a)

{3: [1, 2]}

b)

{3: [1, 2, 4]}

c)

{3: [4]}

d)

Error

83.

क्या सूची को डिक्शनरी में मान के रूप में उपयोग किया जा सकता है?

a)

हां

b)

नहीं

84.

What is Tuple Packing?

a)

Creating a tuple by grouping values together

b)

Extracting values from a tuple

c)

Adding elements to a tuple

d)

Removing elements from a tuple

85.

निम्नलिखित में से कौन सा ट्यूपल पैकिंग का एक उदाहरण है?

a)

t = 1, 2, 3

b)

t = (1, 2, 3)

c)

दोनों

d)

इनमें से कोई नहीं

86.

What is the output of the following code?

nested_list = [[1, 2], [3, [4, 5]]] 

print(nested_list[1][1][0]) 

a)

3

b)

4

c)

5

d)

Error

87.

ट्यूपल अनपैकिंग कब संभव है?

a)

जब तत्वों की संख्या मेल खाती हो।

b)

जब तत्वों की संख्या कम हो।

c)

हमेशा संभव है।

d)

इनमें से कोई नहीं।

88.

What does the following code output?

list1 = [1, 2] 

list2 = [3, 4] 

print(list1 + list2) 

a)

[1, 2, 3, 4]

b)

[1, 2, [3, 4]]

c)

Error

d)

None of the above

89.

क्या सूची के टुकड़े जोड़ने के लिए + ऑपरेटर का उपयोग किया जा सकता है?

a)

हां

b)

नहीं

90.

Can a tuple be used as a key in a dictionary?

a)

Yes, if it contains only immutable elements.

b)

Yes, always.

c)

No, never.

d)

None of the above

91.

क्या डिक्शनरी में म्यूटेबल तत्व कुंजी के रूप में उपयोग किए जा सकते हैं?

a)

हां

b)

नहीं

92.

What does the sort() method do?

a)

Sorts the list in ascending order

b)

Sorts the list in descending order

c)

Both depending on the parameter

d)

None of the above

93.

निम्नलिखित कोड का आउटपुट क्या होगा?

निम्नलिखित कोड का आउटपुट क्या होगा?

list1 = [3, 1, 2] 

list1.sort(reverse=True) 

print(list1) 

a)

[3, 2, 1]

b)

[1, 2, 3]

c)

[2, 3, 1]

d)

त्रुटि

94.

What will the output of this slicing operation be?

list1 = [10, 20, 30, 40] 

print(list1[1:3]) 

a)

[10, 20]

b)

[20, 30]

c)

[30, 40]

d)

Error

95.

क्या सूची का पूरा हिस्सा निकालने के लिए [:] का उपयोग किया जा सकता है?

a)

हां

b)

नहीं

96.

What will len({"a": 1, "b": 2, "c": 3}) return?

a)

3

b)

6

c)

2

d)

Error

97.

डिक्शनरी में कितने कुंजी-मूल्य जोड़े हैं, यह जानने के लिए कौन सी विधि उपयोगी है?

a)

len()

b)

keys()

c)

items()

d)

values()

98.

What will the following code output?

nested_list = [[1, 2], [3, 4, 5]] 

print(len(nested_list)) 

a)

2

b)

5

c)

Error

d)

None of the above

99.

नेस्टेड सूचियों में तत्वों तक पहुँचने के लिए किसका उपयोग किया जाता है?

a)

अनुक्रमण

b)

कुंजियों का

c)

slicing

d)

इनमें से कोई नहीं

100.

What will happen if we try to modify a tuple?

a)

The tuple will be modified.

b)

Error will occur.

c)

It will create a new tuple.

d)

None of the above

101.

क्या ट्यूपल में तत्वों को बदलने की अनुमति है?

a)

हां

b)

नहीं

102.

What is the output of the following code?

data = {"info": [10, 20, {"key": "value"}]} 

print(data["info"][2]["key"]) 

a)

value

b)

key

c)

{"key": "value"}

d)

Error

103.

क्या नेस्टेड डिक्शनरी में तत्वों को नेस्टेड इंडेक्सिंग द्वारा एक्सेस किया जा सकता है?

a)

हां

b)

नहीं