Home
O Level
M1 R5: Information Technology Tools and Network Basics
Introduction to Computers
Office Automation Tools
Internet and Web Technologies
Networking Fundamentals
M2 R5: Web Designing and Publishing
HTML
CSS
Javascript
Web Hosting And Publishing
M3 R5: Programming and Problem Solving through Python
Introduction to Programming
Python Programming
Data Structures in Python
File Processing in Python
M4 R5: Internet of Things (IoT) and Its Applications
Introduction to IoT
IoT Architecture
IoT Applications
IoT Security and Challenges | Soft Skills
Other Courses
Under Graduate Courses
BA
BCA
B.COM
Post Graduate Courses
MCA
MBA
M.COM
MA
M.SC.(MATHS)
MSW
Institutional Courses
DCA
ADCA
DFA
DOAP
TALLY PRIME
JAVA
PYTHON
CCA
C Languages
Job Oriented Courses
Digital Marketing
Full Stack Development
Data Science
Cybersecurity and Ethical Hacking
Blockchain Development
Cloud Computing
Artificial Intelligence (AI) and Machine Learning
Government Courses
CCC
O LEVEL
A LEVEL
Mock Test
M1 R5: Information Technology Tools and Network Basics
M2 R5: Web Designing and Publishing
M3 R5: Programming and Problem Solving through Python
M4 R5: Internet of Things (IoT) and Its Applications
Assignments
HTML
New!
CSS
New!
Javascript
New!
Python
New!
Log in
Sign Up
O Level Papers!
M3 R5: Programming and Problem Solving through Python
Data Structures in Python
Set 7
25
See Explanation !
1
What will be the output of the following Python code? a={1:5,2:3,3:4} a.pop(3) print(a)
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={1:5,2:3,3:4} a.pop(3) print(a)
{1: 5}
{1: 5, 2: 3}
Error, syntax error for pop() method
{1: 5, 3: 4}
Next Question
25
See Explanation !
2
What will be the output of the following Python code? a={1:"A",2:"B",3:"C"} for i in a: print(i,end=" ")
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={1:"A",2:"B",3:"C"} for i in a: print(i,end=" ")
1 2 3
‘A’ ‘B’ ‘C’
1 ‘A’ 2 ‘B’ 3 ‘C’
Error, it should be: for i in a.items():
Previous Question
Next Question
25
See Explanation !
3
What will be the output of the following Python code? a={1:"A",2:"B",3:"C"} print(a.items())
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={1:"A",2:"B",3:"C"} print(a.items())
Syntax error
dict_items([(‘A’), (‘B’), (‘C’)])
dict_items([(1,2,3)])
dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])
Previous Question
Next Question
25
See Explanation !
4
Which of the statements about dictionary values if false?
ड़िक्शनरी वैल्यूज में से कौन सा स्टेट्मेंट यदि गलत है?
More than one key can have the same value
The values of the dictionary can be accessed as dict[key]
Values of a dictionary must be unique
Values of a dictionary can be a mixture of letters and numbers
Previous Question
Next Question
25
>>-del-a" target="_blank">
See Explanation !
>>-del-a" target="_blank">
5
What will be the output of the following Python code snippet? >>> a={1:"A",2:"B",3:"C"} >>> del a
>>-del-a" target="_blank">निम्नलिखित पायथन कोड का आउटपुट क्या होगा? >>> a={1:"A",2:"B",3:"C"} >>> del a
method del doesn’t exist for the dictionary
del deletes the values in the dictionary
del deletes the entire dictionary
del deletes the keys in the dictionary
Previous Question
Next Question
25
See Explanation !
6
If a is a dictionary with some key-value pairs, what does a.popitem() do?
यदि कुछ की-वैल्यू वाले पेअर के साथ एक ड़िक्शनरी है,तो a.popitem () क्या करता है?
Removes an arbitrary element
Removes all the key-value pairs
Removes the key-value pair for the key given as an argument
Invalid method for dictionary
Previous Question
Next Question
25
See Explanation !
7
What will be the output of the following Python code snippet? total={} def insert(items): if items in total: total[items] += 1 else: total[items] = 1 insert('Apple') insert
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? total={} def insert(items): if items in total: total[items] += 1 else: total[items] = 1 insert('Apple') insert('Ball')
3
1
2
0
Previous Question
Next Question
25
See Explanation !
8
What will be the output of the following Python code snippet? a = {} a[1] = 1 a['1'] = 2 a[1]=a[1]+1 count = 0 for i in a: count += a[i] print(count)
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a = {} a[1] = 1 a['1'] = 2 a[1]=a[1]+1 count = 0 for i in a: count += a[i] print(count)
1
2
4
Error, the keys can’t be a mixture of letters and numbers
Previous Question
Next Question
25
See Explanation !
9
What will be the output of the following Python code snippet? numbers = {} letters = {} comb = {} numbers[1] = 56 numbers[3] = 7 letters[4] = 'B'
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? numbers = {} letters = {} comb = {} numbers[1] = 56 numbers[3] = 7 letters[4] = 'B' comb['Numbers']
Error, dictionary in a dictionary can’t exist
‘Numbers’: {1: 56, 3: 7}
{‘Numbers’: {1: 56}, ‘Letters’: {4: ‘B’}}
{‘Numbers’: {1: 56, 3: 7}, ‘Letters’: {4: ‘B’}}
Previous Question
Next Question
25
See Explanation !
10
What will be the output of the following Python code snippet? test = {1:'A', 2:'B', 3:'C'} test = {} print(len(test))
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? test = {1:'A', 2:'B', 3:'C'} test = {} print(len(test))
0
None
3
An exception is thrown
Previous Question
Next Question
25
See Explanation !
11
What will be the output of the following Python code snippet? test = {1:'A', 2:'B', 3:'C'} del test[1] test[1] = 'D' del test[2] print(len(test))
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? test = {1:'A', 2:'B', 3:'C'} del test[1] test[1] = 'D' del test[2] print(len(test))
0
2
Error as the key-value pair of 1:’A’ is already deleted
1
Previous Question
Next Question
25
See Explanation !
12
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) pr
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a = {} a[1] = 1 a['1'] = 2 a[1.0]=4 count = 0 for i in a: count += a[i] print(count) print(a)
An exception is thrown
3
6
2
Previous Question
Next Question
25
See Explanation !
13
What will be the output of the following Python code snippet? a={} a['a']=1 a['b']=[2,3,4] print(a)
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={} a['a']=1 a['b']=[2,3,4] print(a)
Exception is thrown
{‘b’: [2], ‘a’: 1}
{‘b’: [2], ‘a’: [3]}
{'a': 1, 'b': [2, 3, 4]}
Previous Question
Next Question
25
See Explanation !
14
What will be the output of the following Python code? count={} count[(1,2,4)] = 5 count[(4,2,1)] = 7 count[(1,2)] = 6 count[(4,2,1)] = 2 tot = 0
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? count={} count[(1,2,4)] = 5 count[(4,2,1)] = 7 count[(1,2)] = 6 count[(4,2,1)] = 2 tot = 0 for i
25
17
16
Tuples can’t be made keys of a dictionary
Previous Question
Next Question
25
See Explanation !
15
What will be the output of the following Python code? a={} a[2]=1 a[1]=[2,3,4] print(a[1][1])
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={} a[2]=1 a[1]=[2,3,4] print(a[1][1])
[2,3,4]
3
2
An exception is thrown
Previous Question
Next Question
25
See Explanation !
16
What will be the output of the following Python code? a={'B':5,'A':9,'C':7} print(sorted(a))
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a={'B':5,'A':9,'C':7} print(sorted(a))
[‘A’,’B’,’C’]
[‘B’,’C’,’A’]
[5,7,9]
[9,5,7]
Previous Question
Next Question
25
See Explanation !
17
If b is a dictionary, what does any(b) do?
यदि b एक डिक्शनरी है, तो कोई भी (b) क्या करता है?
Returns True if any key of the dictionary is true
Returns False if dictionary is empty
Returns True if all keys of the dictionary are true
Method any() doesn’t exist for dictionary
Previous Question
Next Question
25
See Explanation !
18
What will be the output of the following Python code? a=dict() print(a[1])
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? a=dict() print(a[1])
An exception is thrown since the dictionary is empty
‘ ‘
1
0
Previous Question
Next Question
25
See Explanation !
19
The data structure which is a mutable ordered sequence of elements is called
डेटा संरचना जो तत्वों का एक परिवर्तनशील क्रमबद्ध अनुक्रम है, कहलाती है
Built in
List
Tuple
Derived data
Previous Question
Next Question
25
See Explanation !
20
A sequence of immutable objects is called
अपरिवर्तनीय वस्तुओं का क्रम कहलाता है
Built in
List
Tuple
Derived data
Previous Question
Next Question
25
See Explanation !
21
Which of the following function of dictionary gets all the keys from the dictionary
निम्नलिखित में से डिक्शनरी का कौन सा फ़ंक्शन डिक्शनरी से सभी की निकालने के लिए किया जाता है
getkeys()
key()
keys()
none of the mentioned
Previous Question
Next Question
25
See Explanation !
22
Which statement is correct
कौन सा कथन सही है
List is mutable & Tuple is immutable
List is immutable & Tuple is mutable
Both List and Tuple are Mutable
Both List and Tuple are Immutable
Previous Question
Next Question
25
See Explanation !
23
What data type is the object below ? L=[1, 23, 'hello', 1]
नीचे दिया गया ऑब्जेक्ट किस डेटा प्रकार का है? L=[1, 23, 'hello', 1]
List
Dictionary
Tuple
Array
Previous Question
Next Question
25
See Explanation !
24
What is the output of the following program ? print "Hello World".[::-1]
निम्नलिखित प्रोग्राम का आउटपुट क्या है? print "Hello World".[::-1]
dlroWolleH
Hello Worl
d
Error
Previous Question
Next Question
25
See Explanation !
25
Given a string s="Welcome", which of the following code is incorrect ?
एक स्ट्रिंग s="Welcome" दी गई है, निम्नलिखित में से कौन सा कोड गलत है?
print s[0]
print s.lower()
s[1]='r'
print s.strip()
Previous Question