Skip to document
Was this document helpful?

Python interview questions

Course: python programming (cs8151)

86 Documents
Students shared 86 documents in this course

University: Anna University

Was this document helpful?
http://www.tutorialspoint.com/python/python_interview_questions.htm Copyright © tutorialspoint.com
PYTHON INTERVIEW QUESTIONS
PYTHON INTERVIEW QUESTIONS
Dear readers, these Python Programming Language Interview Questions have been
designed specially to get you acquainted with the nature of questions you may encounter during
your interview for the subject of Python Programming Language. As per my experience good
interviewers hardly plan to ask any particular question during your interview, normally questions
start with some basic concept of the subject and later they continue based on further discussion
and what you answer 2
What is Python?
Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is
designed to be highly readable. It uses English keywords frequently where as other languages use
punctuation, and it has fewer syntactical constructions than other languages.
Name some of the features of Python.
Following are some of the salient features of python 2
It supports functional and structured programming methods as well as OOP.
It can be used as a scripting language or can be compiled to byte-code for building large
applications.
It provides very high-level dynamic data types and supports dynamic type checking.
It supports automatic garbage collection.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
What is the purpose of PYTHONPATH environment variable?
PYTHONPATH - It has a role similar to PATH. This variable tells the Python interpreter where to
locate the module files imported into a program. It should include the Python source library
directory and the directories containing Python source code. PYTHONPATH is sometimes preset by
the Python installer.
What is the purpose of PYTHONSTARTUP environment variable?
PYTHONSTARTUP - It contains the path of an initialization file containing Python source code. It is
executed every time you start the interpreter. It is named as .pythonrc.py in Unix and it contains
commands that load utilities or modify PYTHONPATH.
What is the purpose of PYTHONCASEOK environment variable?
PYTHONCASEOK 2 It is used in Windows to instruct Python to find the first case-insensitive match in
an import statement. Set this variable to any value to activate it.
What is the purpose of PYTHONHOME environment variable?
PYTHONHOME 2 It is an alternative module search path. It is usually embedded in the
PYTHONSTARTUP or PYTHONPATH directories to make switching module libraries easy.
Is python a case sensitive language?
Yes! Python is a case sensitive programming language.
What are the supported data types in Python?
Python has five standard data types 2
Numbers
String