0% found this document useful (0 votes)
10 views

iNeuron Day 12 python interview questions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

iNeuron Day 12 python interview questions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

iNeuron Intelligence Pvt Ltd

1. What is the Arithme.c operators precedence in Python?


Ans- When more than one arithme.c operator appears in an expression the
opera.ons will execute in a specific order. In Python the opera.on precedence
follows as per the acronym PEMDAS.
Parenthesis
Exponent
Mul.plica.on
Addi.on
Division
Subtrac.on
Q4. Evaluate the following keeping Python’s precedence of operators.
a=2
b=4
c=5
d=4

print(a+b+c)
print(a+b*c+d)
print(a/b+c/d)
print(a+b*c+a/b+d)
Ans-

2. What are rela.onal operators?


Ans- Rela.onal operators are known as condi.onal operators.

Page 2 of 9
iNeuron Intelligence Pvt Ltd

Equal

x=y

True if x is equal to y.

>

Greater than

x>y

True if x is greater than y.

<

Less than

x<y

True if x is less than y.

>=

Greater than or equal to

x >= y

True if x is greater than or equal to y.

<=

Less than or equal to


Page 3 of 9
iNeuron Intelligence Pvt Ltd

x <= y

True if x is less than or equal to y.

!=

Not equal to

x != y

True if x is not equal to y.

3. a = 5, b = 6, c = 7, d = 7
What will be the outcome for the following:
1. a <=b>=c
2. -a+b==c>d
3. b+c==6+d>=13
Ans-

4. What is the func.on of pickling in python?


a. Conversion of a python object
b. Conversion of database into list
c. Conversion of byte stream into python object hierarchy

Page 4 of 9
iNeuron Intelligence Pvt Ltd

d. Conversion of list into database

Answer. a. The process of pickling refers to sterilizing a Python object, which


means conver.ng a byte stream into python object hierarchy. The process
which is the opposite of pickling is called unpickling.

5. What is Python code-compiled or interpreted?


a. The code is both compiled and interpreted
b. Neither compiled nor interpreted
c. Only compiled
d. Only interpreted

Answer. b. There are a lot of languages which have been implemented using
both compilers and interpreters, including C, Pascal, as well as python.

6. When was Python released?


1. 16 October, 2001
2. 16 October 2000
3. 17 October 2000
4. 17 October 2001

Answer. b. 16 October 2000. The idea of Python was conceived in the later
1980s, but it was released on a. 16 October 2000.

7. When was Python 3.0 released?


1. 3 December 2008
2. 4 December 2008
3. 5 December 2008
4. 3 December 2010

Answer. a. The new version of Python 3.0 was released on December 3, 2008.

Page 5 of 9
iNeuron Intelligence Pvt Ltd

8. Who founded Python?


1. Alexander G. Bell
2. Vincent van Gogh
3. Leonardo da Vinci
4. Guido van Rossum

Answer. d. The idea of Python was conceived by Guido van Rossum in the later
1980s.

9. What is Python?
1. A programming language
2. Computer language
3. Binary language
4. None of the above
Answer. a. Python is a programming language, basically a very high-level and a
general-purpose language.

10. What are the people who specialize in Python called?


1. Pythonic
2. Unpythonic
3. Monty Python
4. Pythoniasts
Answer. d. the people who specialize, or are great admirers of this
programming language are called as Pythoniasts. They are extremely
knowledgeable people.

11. What is the type of programming language supported by Python?


1. Object-oriented
2. Func.onal programming
3. Structured programming
4. All of the above
Page 6 of 9
iNeuron Intelligence Pvt Ltd

Answer. d. Python is an interpreted programming language, suppor.ng object-


oriented, structured, and func.onal programming.

12. When Python is dealing with iden.fiers, is it case sensi.ve?


1. Yes
2. No
3. Machine dependent
4. Can’t say
Answer. a. It is case sensi.ve.

13. What is the extension of the Python file?


1. .pl
2. .py
3. .python
4. .p

Answer. b. The correct extension of python is .py and can be wrilen in any text
editor. We need to use the extension .py to save these files.

14. All the keywords in Python are in_


1. Lower case
2. Upper case
3. Capitalized
4. None of the above

Answer. d. Only True, False and None are capitalized and all the others in lower
case.

15. What does pip mean in Python?


1. Unlimited length
2. All private members must have leading and trailing underscores
Page 7 of 9
iNeuron Intelligence Pvt Ltd

3. Preferred Installer Program


4. None of the above

Answer. c. Variable names can be of any length.

16. The built-in func.on in Python is:


1. Print ()
2. Seed ()
3. Sqrt ()
4. Factorial ()

Answer. a. The func.on seed is a func.on which is present in the random


module. The func.ons sqrt and factorial are a part of the math module. The
print func.on is a built-in func.on which prints a value directly to the system
output.

17. Which of the following defini.ons is the one for packages in Python?
1. A set of main modules
2. A folder of python modules
3. Set of programs making use of python modules
4. Number of files containing python defini.ons and statements

Answer. b. A folder of python modules is called as package of modules.

18. What is the order in which namespaces in Python looks for an iden.fier?
1. First, the python searches for the built-in namespace, then the global
namespace and then the local namespace
2. Python first searches for the built-in namespace, then local and finally
the global namespace
3. Python first searches for local namespace, then global namespace and
finally the built-in namespace

Page 8 of 9
iNeuron Intelligence Pvt Ltd

4. Python searches for the global namespace, followed by the local


namespace and finally the built-in namespace.

Answer. C. Python first searches for the local namespace, followed by the
global and finally the built-in namespace.

19. Which of the following is not a keyword used in Python language?


1. Pass
2. Eval
3. Assert
4. Nonlocal

Answer. b. Eval is used as a variable in Python.

20. Which of the following is the use of func3on in python?


1. Func3ons do not provide be=er modularity for applica3ons
2. One can’t create our own func3ons
3. Func3ons are reusable pieces of programs
4. All of the above

Answer. c. Func3ons are reusable pieces of programs, which allow us


to give a name to a par3cular block of statements, allowing us to run
the block using the specified name anywhere in our program and any
number of 3mes.

Page 9 of 9

You might also like