PYTHON Interview Questions1
PYTHON Interview Questions1
Page 2 of 8
iNeuron Intelligence Pvt Ltd
Answer: c
Explana@on: Python first searches for the local, then the global and
finally the built-in namespace.
Answer: b
Explana@on: eval can be used as a variable.
Page 3 of 8
iNeuron Intelligence Pvt Ltd
Answer: c
Explana@on: Func@ons are reusable pieces of programs. They allow
you to give a name to a block of statements, allowing you to run that
block using the specified name anywhere in your program and any
number of @mes.
Answer: d
Explana@on: Iden@fiers can be of any length.
Answer: c
Explana@on: Built-in func@ons and user defined ones. The built-in
func@ons are part of the Python language. Examples are: dir(), len()
or abs(). The user defined func@ons are func@ons created with the
def keyword.
Page 4 of 8
iNeuron Intelligence Pvt Ltd
Answer: d
Explana@on: Tuples are represented with round brackets.
Answer: b
Explana@on: Each object in Python has a unique id. The id() func@on
returns the object’s id.
Answer: a
Explana@on: Pickling is the process of serializing a Python object, that
is, conversion of a Python object hierarchy into a byte stream. The
reverse of this process is known as unpickling.
Page 5 of 8
iNeuron Intelligence Pvt Ltd
Answer: b
Explana@on: Neither of 0.1, 0.2 and 0.3 can be represented
accurately in binary. The round off errors from 0.1 and 0.2
accumulate and hence there is a difference of 5.5511e-17 between
(0.1 + 0.2) and 0.3.
Answer: c
Explana@on: l (or L) stands for long.
Answer: d
Explana@on: Numbers star@ng with a 0 are octal numbers but 9 is not
allowed in octal numbers.
Page 6 of 8
iNeuron Intelligence Pvt Ltd
Page 7 of 8
iNeuron Intelligence Pvt Ltd
Page 8 of 8