Home
MCQs by exam
Python Developer Interviews
Data Science
Python Developer Interviews MCQs – Data Science
26 multiple choice questions typical of the Python Developer Interviews exam, with answers and explanations. Switch on practice mode to test yourself first.
A
'ababab'
Correct answer
B
TypeError
C
'aaabbb'
D
'ab3'
A
None
B
KeyError
C
0
Correct answer
D
''
A
__init__, __repr__ and __eq__ methods
Correct answer
B
A database table for the class
C
Getter and setter for each field
D
Type checking at runtime for fields
A
The string '123'
B
A tuple of strings
C
The list ['1', '2', '3']
D
A lazy map iterator
Correct answer
A
No automatic argument
B
The class itself (cls)
Correct answer
C
The parent module
D
The instance (self)
A
True
B
[3, 1, 2]
C
[1, 2, 3]
D
None
Correct answer
A
[1, 2, 3]
B
[2, 3]
Correct answer
C
2
D
(2, 3)
A
None
B
TypeError
C
False
D
True
Correct answer
A
nonlocal
Correct answer
B
outer
C
static
D
global
A
'-a-b-c-'
B
['a-b-c']
C
'abc-'
D
'a-b-c'
Correct answer
A
False
B
5
C
True
Correct answer
D
None
A
{2: 'hi', 3: 'cat'}
B
{2, 3}
C
{'hi': 2, 'cat': 3}
Correct answer
D
[2, 3]
A
10
B
An IndexError
C
40
Correct answer
D
30
A
8
B
2
C
1
D
4
Correct answer
A
Assigns a value inside an expression
Correct answer
B
Compares two values for identity
C
Swaps the values of two variables
D
Declares a constant that cannot change
A
To copy the list faster using less memory
B
To remove duplicate items while copying
C
To convert the list into an immutable tuple
D
To copy the inner lists as well
Correct answer
A
[1, 'a', 2, 'b', 3]
B
An error because the lengths differ
C
[(1, 'a'), (2, 'b')]
Correct answer
D
[(1, 'a'), (2, 'b'), (3, None)]
A
(0, 'a') and (1, 'b')
B
(1, 'a') and (2, 'b')
Correct answer
C
(1, 'b') and (2, 'a')
D
('a', 1) and ('b', 2)
A
['banana', 'kiwi', 'fig']
B
['fig', 'kiwi', 'banana']
Correct answer
C
['banana', 'fig', 'kiwi']
D
['fig', 'banana', 'kiwi']
A
'ytho'
B
'yth'
Correct answer
C
'pyt'
D
'pyth'
A
Global variables cannot be read by any function
B
Each thread receives its own private memory heap
C
Only one thread executes Python bytecode at a time
Correct answer
D
Python code always runs on all CPU cores at once
A
It returns a generator that yields lazily
Correct answer
B
It returns all of its values at once in a list
C
It can only be called once in the whole program
D
It pauses the entire program until input arrives
A
A tool that formats code according to PEP 8
B
A comment that documents what a function does
C
A function that wraps another function
Correct answer
D
A special variable that stores class constants
A
A tuple and a dictionary
Correct answer
B
A dictionary and a tuple
C
Two separate lists
D
A list and a set
A
An error
B
[1, 2]
Correct answer
C
[2]
D
[1]
Practise on paper
Preparing for Python Developer Interviews?
Make it your exam plan: see your progress in every subject and topic, set a daily goal and practise what you have not done yet.
Start my Python Developer Interviews plan
Test yourself
Take a timed online test and get a certificate, or play today's quick quiz.
Online tests
Daily quiz