SlideShare a Scribd company logo
Python Interview Questions
A list of top frequently asked Python interview questions
and answers are given below.
1) What is Python?
Python is a high level object-oriented programming language
with objects, modules, threads, exceptions and automatic
memory management. It is a simple yet powerful
programming language. It can run equally on different
platforms such as Windows, Linux, UNIX, Macintosh etc. Thus,
Python is a portable language.
2) What are the advantages of Python?
Following are the main advantages of using Python.
◦ Free and open source
◦ Portable
◦ Extensible
◦ Object oriented
◦ Built-in data structure
3)What is PEP 8?
PEP 8 is a coding convention which specifies a set of
guidelines, about how to write your Python code more
readable.
4) What is used to create Unicode string in
Python?
You should use "Unicode" before the string. For example:
Unicode (text).
5) Explain how Python is interpreted?
Python is an interpreted language. The Python language
program runs directly from the source code. It converts the
source code into an intermediate language, which is again
translated into machine language that has to be executed.
6) How memory is managed in Python?
Memory is managed in Python in following way:
◦ Memory is managed in Python by private heap space. All
Python objects and data structures are located in a
private heap. The programmer does not have an access
to this private heap and interpreter takes care of this
Python private heap.
◦ Python memory manager is responsible for allocating Python
heap space for Python objects.
◦ Python also have an inbuilt garbage collector, which recycle
all the unused memory and frees the memory and makes
it available to the heap space.
7) What is Python decorator?
A Python decorator is a specific change made within Python
syntax to alter functions easily.
8) What are the rules for local and global
variable in Python?
In Python, variables that are only referenced inside a function
are called implicitly global. If a variable is assigned a new
value anywhere within the function's body, it's assumed to be
a local. If a variable is ever assigned a new value inside the
function, the variable is implicitly local, and you need to
explicitly declare it as 'global'.
9) What is namespace in Python?
In Python, every name has a place where it lives and can be
hooked for. This is known as namespace. It is like a box where
a variable name is mapped to the object placed. Whenever the
variable is searched out, this box will be searched, to get
corresponding object.
10) What are iterators in Python?
In Python, iterators are used to iterate a group of elements,
containers like list.
11) What is generator in Python?
In Python, generator is a way that specifies how to implement
iterators. It is a normal function except that it yields
expression in the function.
12) What is slicing in Python?
Slicing is a mechanism used to select a range of items from
sequence type like list, tuple, string etc.
13) What is dictionary in Python?
The built-in datatypes in Python is called dictionary. It defines
one-to-one relationship between keys and values. Dictionaries
contain pair of keys and their corresponding values.
Dictionaries are indexed by keys.
Let's take an example
The following example contains some keys ? Country Hero &
Cartoon. Their corresponding values are India, Modi and Rahul
respectively.
1 >>> dict = {'Country': 'India', 'Hero': 'Modi', 'Cartoon': 'Rah
ul'}
2 >>>print dict[Country]
3 India
4 >>>print dict[Hero]
5 Modi
6 >>>print dict[Cartoon]
7 Rahul
14) What is Pass in Python?
Pass specifies a Python statement without operations. It is a
place holder in a compound statement, where there should be
a blank left and nothing has to be written there.
15) Explain docstring in Python?
A Python documentation string is called docstring. It is used
for documenting Python functions, modules and classes.
16) What is negative index in Python?
Python sequences are indexed in positive and negative
numbers. For example: 0 is the first positive index, 1 is the
second positive index and so on. For negative indexes -1 is the
last negative index, -2 is the second last negative index and so
on.
17) What is pickling and unpickling in
Python?
Pickling is a process in which a pickle module accepts any
Python object, converts it into a string representation and
dumps it into a file by using dump() function.
Unpickling is a process of retrieving original Python object
from the stored string representation for use.
Pickleis a standard modulewhich serializes and de-serializes
a Python objectstructure.
18) How can you make forms in Python?
You have to import cgi module to access form fields using
FieldStorage class.
Attributes of class FieldStorage for form:
form.name: The name of the field, if specified.
form.filename: If an FTP transaction, the client-side
filename.
form.value: The value of the field as a string.
form.file: file object from which data can be read.
form.type: The content type, if applicable.
form.type_options: The options of the 'content-type' line of
the HTTP request, returned as a dictionary.
form.disposition: The field 'content-disposition'; None, if
unspecified.
form.disposition_options: The options for 'content-
disposition'.
form.headers: All of the HTTP headers returned as a
dictionary.
Example
1 import cgi
2 form = cgi.FieldStorage()
3 if not (form.has_key("name") and form.has_key("age")):
4 print "<H1>Name & Age not Entered</H1>"
5 print "Fill the Name & Age accurately."
6 return
7 print "<p>name:", form["name"].value
8 print "<p>Age:", form["age"].value
19)What are the differences between
Python 2.x and Python 3.x?
Python 2.x is an older version of Python. It is a legacy now.
Python 3.x is newer. It is the present and future of this
language.
The most visible difference between them is in print
statement. In Python 2 it is print ?Hello? and in Python 3, it is
print (?Hello?).
20)How can you organize your code to
make it easier to change the base class?
You have to define an alias for the base class, assign the real
base class to it before your class definition, and use the alias
throughout your class. you can also use this method if you
want to decide dynamically (e.g. depending on availability of
resources) which base class to use.
Example
1 BaseAlias = <real base class>
2 class Derived(BaseAlias):
3 def meth(self):
4 BaseAlias.meth(self)

More Related Content

What's hot

Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
 
Python ppt
Python pptPython ppt
Python ppt
Rohit Verma
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
RaginiJain21
 
Python ppt
Python pptPython ppt
Python ppt
Anush verma
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
Dr.YNM
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
VigneshVijay21
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
BharathYusha1
 
Python ppt
Python pptPython ppt
Python ppt
Mohita Pandey
 
Python PPT
Python PPTPython PPT
Python PPT
Edureka!
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Python training
Python trainingPython training
Python training
Kunalchauhan76
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Abhijeet Singh
 
Python
PythonPython
Python
Shivam Gupta
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
Hansi Thenuwara
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 
Python basics
Python basicsPython basics
Python basics
Jyoti shukla
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Python programming
Python  programmingPython  programming
Python programming
Ashwin Kumar Ramasamy
 

What's hot (20)

Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
 
Python ppt
Python pptPython ppt
Python ppt
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
Python ppt
Python pptPython ppt
Python ppt
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 
Python ppt
Python pptPython ppt
Python ppt
 
Python PPT
Python PPTPython PPT
Python PPT
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Python training
Python trainingPython training
Python training
 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
 
Python
PythonPython
Python
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 
Python basics
Python basicsPython basics
Python basics
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Python programming
Python  programmingPython  programming
Python programming
 

Viewers also liked

CMP 2-13-16
CMP 2-13-16CMP 2-13-16
CMP 2-13-16
rastapup
 
BET TRADERS WIN
BET TRADERS WINBET TRADERS WIN
BET TRADERS WIN
Julius Jack Armstrong
 
CompTIA Network+ N10-006
CompTIA Network+ N10-006CompTIA Network+ N10-006
CompTIA Network+ N10-006Tertius Stander
 
DALICC (Data Licenses Clearance Centre)
DALICC (Data Licenses Clearance Centre)DALICC (Data Licenses Clearance Centre)
DALICC (Data Licenses Clearance Centre)
Stadt Wien
 
Deployment and distribution- iOS
Deployment and distribution- iOSDeployment and distribution- iOS
Deployment and distribution- iOS
Suraj B
 
Literacy and numeracy
Literacy and numeracyLiteracy and numeracy
Literacy and numeracy
Dutot Caroline
 
Jude Cosgrove - Early child health and cognitive outcomes: secondary analysi...
Jude Cosgrove  - Early child health and cognitive outcomes: secondary analysi...Jude Cosgrove  - Early child health and cognitive outcomes: secondary analysi...
Jude Cosgrove - Early child health and cognitive outcomes: secondary analysi...
Institute of Public Health in Ireland
 
Numeracy Information Evening KS1
Numeracy Information Evening KS1Numeracy Information Evening KS1
Numeracy Information Evening KS1rpalmerratcliffe
 
Agile ncr agile coaching-v1
Agile ncr agile coaching-v1Agile ncr agile coaching-v1
Agile ncr agile coaching-v1
AgileNCR2016
 
CONSTRUCT YOUR DREAM HOME
  CONSTRUCT YOUR DREAM HOME  CONSTRUCT YOUR DREAM HOME
CONSTRUCT YOUR DREAM HOME
Bangalore Property
 
ECM Pre-Numeracy for Kindergarten
ECM Pre-Numeracy for KindergartenECM Pre-Numeracy for Kindergarten
ECM Pre-Numeracy for Kindergarten
Jimmy Keng
 
Literacy & Numeracy Week 2013 Reading With Our Buddies
Literacy & Numeracy Week 2013  Reading With Our BuddiesLiteracy & Numeracy Week 2013  Reading With Our Buddies
Literacy & Numeracy Week 2013 Reading With Our BuddiesStuart Meachem
 
01 июля 2016 года на базе мбдоу
01 июля 2016 года на базе мбдоу01 июля 2016 года на базе мбдоу
01 июля 2016 года на базе мбдоу
virtualtaganrog
 

Viewers also liked (13)

CMP 2-13-16
CMP 2-13-16CMP 2-13-16
CMP 2-13-16
 
BET TRADERS WIN
BET TRADERS WINBET TRADERS WIN
BET TRADERS WIN
 
CompTIA Network+ N10-006
CompTIA Network+ N10-006CompTIA Network+ N10-006
CompTIA Network+ N10-006
 
DALICC (Data Licenses Clearance Centre)
DALICC (Data Licenses Clearance Centre)DALICC (Data Licenses Clearance Centre)
DALICC (Data Licenses Clearance Centre)
 
Deployment and distribution- iOS
Deployment and distribution- iOSDeployment and distribution- iOS
Deployment and distribution- iOS
 
Literacy and numeracy
Literacy and numeracyLiteracy and numeracy
Literacy and numeracy
 
Jude Cosgrove - Early child health and cognitive outcomes: secondary analysi...
Jude Cosgrove  - Early child health and cognitive outcomes: secondary analysi...Jude Cosgrove  - Early child health and cognitive outcomes: secondary analysi...
Jude Cosgrove - Early child health and cognitive outcomes: secondary analysi...
 
Numeracy Information Evening KS1
Numeracy Information Evening KS1Numeracy Information Evening KS1
Numeracy Information Evening KS1
 
Agile ncr agile coaching-v1
Agile ncr agile coaching-v1Agile ncr agile coaching-v1
Agile ncr agile coaching-v1
 
CONSTRUCT YOUR DREAM HOME
  CONSTRUCT YOUR DREAM HOME  CONSTRUCT YOUR DREAM HOME
CONSTRUCT YOUR DREAM HOME
 
ECM Pre-Numeracy for Kindergarten
ECM Pre-Numeracy for KindergartenECM Pre-Numeracy for Kindergarten
ECM Pre-Numeracy for Kindergarten
 
Literacy & Numeracy Week 2013 Reading With Our Buddies
Literacy & Numeracy Week 2013  Reading With Our BuddiesLiteracy & Numeracy Week 2013  Reading With Our Buddies
Literacy & Numeracy Week 2013 Reading With Our Buddies
 
01 июля 2016 года на базе мбдоу
01 июля 2016 года на базе мбдоу01 июля 2016 года на базе мбдоу
01 июля 2016 года на базе мбдоу
 

Similar to Python interview questions

Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
Excellence Academy
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
zynofustechnology
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
RojaPriya
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
kavinilavuG
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdf
alaparthi
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning
ParrotAI
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Python intro
Python introPython intro
Python intro
Piyush rai
 
Python unit1
Python unit1Python unit1
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
 
Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
AdnanAhmad57885
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
UttamKumar617567
 
Intro to python
Intro to pythonIntro to python
Intro to python
Mohamed Essam
 
Top Most Python Interview Questions.pdf
Top Most Python Interview Questions.pdfTop Most Python Interview Questions.pdf
Top Most Python Interview Questions.pdf
Datacademy.ai
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
prakash ppt (2).pdf
prakash ppt (2).pdfprakash ppt (2).pdf
prakash ppt (2).pdf
ShivamKS4
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
jaba kumar
 
About python
About pythonAbout python
About python
satyabrata panda
 
Top 20 Python Interview Questions And Answers 2023.pdf
Top 20 Python Interview Questions And Answers 2023.pdfTop 20 Python Interview Questions And Answers 2023.pdf
Top 20 Python Interview Questions And Answers 2023.pdf
AnanthReddy38
 

Similar to Python interview questions (20)

Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python_Unit_1.pdf
Python_Unit_1.pdfPython_Unit_1.pdf
Python_Unit_1.pdf
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
 
Python intro
Python introPython intro
Python intro
 
Python unit1
Python unit1Python unit1
Python unit1
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
 
Intro to python
Intro to pythonIntro to python
Intro to python
 
Top Most Python Interview Questions.pdf
Top Most Python Interview Questions.pdfTop Most Python Interview Questions.pdf
Top Most Python Interview Questions.pdf
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
prakash ppt (2).pdf
prakash ppt (2).pdfprakash ppt (2).pdf
prakash ppt (2).pdf
 
Python - Module 1.ppt
Python - Module 1.pptPython - Module 1.ppt
Python - Module 1.ppt
 
About python
About pythonAbout python
About python
 
Top 20 Python Interview Questions And Answers 2023.pdf
Top 20 Python Interview Questions And Answers 2023.pdfTop 20 Python Interview Questions And Answers 2023.pdf
Top 20 Python Interview Questions And Answers 2023.pdf
 

More from Pragati Singh

Nessus Scanner: Network Scanning from Beginner to Advanced!
Nessus Scanner: Network Scanning from Beginner to Advanced! Nessus Scanner: Network Scanning from Beginner to Advanced!
Nessus Scanner: Network Scanning from Beginner to Advanced!
Pragati Singh
 
Tenable Certified Sales Associate - CS.pdf
Tenable Certified Sales Associate - CS.pdfTenable Certified Sales Associate - CS.pdf
Tenable Certified Sales Associate - CS.pdf
Pragati Singh
 
Analyzing risk (pmbok® guide sixth edition)
Analyzing risk (pmbok® guide sixth edition)Analyzing risk (pmbok® guide sixth edition)
Analyzing risk (pmbok® guide sixth edition)
Pragati Singh
 
Pragati Singh | Sap Badge
Pragati Singh | Sap BadgePragati Singh | Sap Badge
Pragati Singh | Sap Badge
Pragati Singh
 
Ios record of achievement
Ios  record of achievementIos  record of achievement
Ios record of achievement
Pragati Singh
 
Ios2 confirmation ofparticipation
Ios2 confirmation ofparticipationIos2 confirmation ofparticipation
Ios2 confirmation ofparticipation
Pragati Singh
 
Certificate of completion android studio essential training 2016
Certificate of completion android studio essential training 2016Certificate of completion android studio essential training 2016
Certificate of completion android studio essential training 2016
Pragati Singh
 
Certificate of completion android development essential training create your ...
Certificate of completion android development essential training create your ...Certificate of completion android development essential training create your ...
Certificate of completion android development essential training create your ...
Pragati Singh
 
Certificate of completion android development essential training design a use...
Certificate of completion android development essential training design a use...Certificate of completion android development essential training design a use...
Certificate of completion android development essential training design a use...
Pragati Singh
 
Certificate of completion android development essential training support mult...
Certificate of completion android development essential training support mult...Certificate of completion android development essential training support mult...
Certificate of completion android development essential training support mult...
Pragati Singh
 
Certificate of completion android development essential training manage navig...
Certificate of completion android development essential training manage navig...Certificate of completion android development essential training manage navig...
Certificate of completion android development essential training manage navig...
Pragati Singh
 
Certificate of completion android development essential training local data s...
Certificate of completion android development essential training local data s...Certificate of completion android development essential training local data s...
Certificate of completion android development essential training local data s...
Pragati Singh
 
Certificate of completion android development essential training distributing...
Certificate of completion android development essential training distributing...Certificate of completion android development essential training distributing...
Certificate of completion android development essential training distributing...
Pragati Singh
 
Certificate of completion android app development communicating with the user
Certificate of completion android app development communicating with the userCertificate of completion android app development communicating with the user
Certificate of completion android app development communicating with the user
Pragati Singh
 
Certificate of completion building flexible android apps with the fragments api
Certificate of completion building flexible android apps with the fragments apiCertificate of completion building flexible android apps with the fragments api
Certificate of completion building flexible android apps with the fragments api
Pragati Singh
 
Certificate of completion android app development design patterns for mobile ...
Certificate of completion android app development design patterns for mobile ...Certificate of completion android app development design patterns for mobile ...
Certificate of completion android app development design patterns for mobile ...
Pragati Singh
 
Certificate of completion java design patterns and apis for android
Certificate of completion java design patterns and apis for androidCertificate of completion java design patterns and apis for android
Certificate of completion java design patterns and apis for android
Pragati Singh
 
Certificate of completion android development concurrent programming
Certificate of completion android development concurrent programmingCertificate of completion android development concurrent programming
Certificate of completion android development concurrent programming
Pragati Singh
 
Certificate of completion android app development data persistence libraries
Certificate of completion android app development data persistence librariesCertificate of completion android app development data persistence libraries
Certificate of completion android app development data persistence libraries
Pragati Singh
 
Certificate of completion android app development restful web services
Certificate of completion android app development restful web servicesCertificate of completion android app development restful web services
Certificate of completion android app development restful web services
Pragati Singh
 

More from Pragati Singh (20)

Nessus Scanner: Network Scanning from Beginner to Advanced!
Nessus Scanner: Network Scanning from Beginner to Advanced! Nessus Scanner: Network Scanning from Beginner to Advanced!
Nessus Scanner: Network Scanning from Beginner to Advanced!
 
Tenable Certified Sales Associate - CS.pdf
Tenable Certified Sales Associate - CS.pdfTenable Certified Sales Associate - CS.pdf
Tenable Certified Sales Associate - CS.pdf
 
Analyzing risk (pmbok® guide sixth edition)
Analyzing risk (pmbok® guide sixth edition)Analyzing risk (pmbok® guide sixth edition)
Analyzing risk (pmbok® guide sixth edition)
 
Pragati Singh | Sap Badge
Pragati Singh | Sap BadgePragati Singh | Sap Badge
Pragati Singh | Sap Badge
 
Ios record of achievement
Ios  record of achievementIos  record of achievement
Ios record of achievement
 
Ios2 confirmation ofparticipation
Ios2 confirmation ofparticipationIos2 confirmation ofparticipation
Ios2 confirmation ofparticipation
 
Certificate of completion android studio essential training 2016
Certificate of completion android studio essential training 2016Certificate of completion android studio essential training 2016
Certificate of completion android studio essential training 2016
 
Certificate of completion android development essential training create your ...
Certificate of completion android development essential training create your ...Certificate of completion android development essential training create your ...
Certificate of completion android development essential training create your ...
 
Certificate of completion android development essential training design a use...
Certificate of completion android development essential training design a use...Certificate of completion android development essential training design a use...
Certificate of completion android development essential training design a use...
 
Certificate of completion android development essential training support mult...
Certificate of completion android development essential training support mult...Certificate of completion android development essential training support mult...
Certificate of completion android development essential training support mult...
 
Certificate of completion android development essential training manage navig...
Certificate of completion android development essential training manage navig...Certificate of completion android development essential training manage navig...
Certificate of completion android development essential training manage navig...
 
Certificate of completion android development essential training local data s...
Certificate of completion android development essential training local data s...Certificate of completion android development essential training local data s...
Certificate of completion android development essential training local data s...
 
Certificate of completion android development essential training distributing...
Certificate of completion android development essential training distributing...Certificate of completion android development essential training distributing...
Certificate of completion android development essential training distributing...
 
Certificate of completion android app development communicating with the user
Certificate of completion android app development communicating with the userCertificate of completion android app development communicating with the user
Certificate of completion android app development communicating with the user
 
Certificate of completion building flexible android apps with the fragments api
Certificate of completion building flexible android apps with the fragments apiCertificate of completion building flexible android apps with the fragments api
Certificate of completion building flexible android apps with the fragments api
 
Certificate of completion android app development design patterns for mobile ...
Certificate of completion android app development design patterns for mobile ...Certificate of completion android app development design patterns for mobile ...
Certificate of completion android app development design patterns for mobile ...
 
Certificate of completion java design patterns and apis for android
Certificate of completion java design patterns and apis for androidCertificate of completion java design patterns and apis for android
Certificate of completion java design patterns and apis for android
 
Certificate of completion android development concurrent programming
Certificate of completion android development concurrent programmingCertificate of completion android development concurrent programming
Certificate of completion android development concurrent programming
 
Certificate of completion android app development data persistence libraries
Certificate of completion android app development data persistence librariesCertificate of completion android app development data persistence libraries
Certificate of completion android app development data persistence libraries
 
Certificate of completion android app development restful web services
Certificate of completion android app development restful web servicesCertificate of completion android app development restful web services
Certificate of completion android app development restful web services
 

Recently uploaded

How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Python interview questions

  • 1. Python Interview Questions A list of top frequently asked Python interview questions and answers are given below. 1) What is Python? Python is a high level object-oriented programming language with objects, modules, threads, exceptions and automatic memory management. It is a simple yet powerful programming language. It can run equally on different platforms such as Windows, Linux, UNIX, Macintosh etc. Thus, Python is a portable language. 2) What are the advantages of Python? Following are the main advantages of using Python. ◦ Free and open source ◦ Portable ◦ Extensible ◦ Object oriented ◦ Built-in data structure 3)What is PEP 8? PEP 8 is a coding convention which specifies a set of guidelines, about how to write your Python code more readable. 4) What is used to create Unicode string in Python? You should use "Unicode" before the string. For example: Unicode (text). 5) Explain how Python is interpreted? Python is an interpreted language. The Python language program runs directly from the source code. It converts the source code into an intermediate language, which is again translated into machine language that has to be executed. 6) How memory is managed in Python? Memory is managed in Python in following way: ◦ Memory is managed in Python by private heap space. All
  • 2. Python objects and data structures are located in a private heap. The programmer does not have an access to this private heap and interpreter takes care of this Python private heap. ◦ Python memory manager is responsible for allocating Python heap space for Python objects. ◦ Python also have an inbuilt garbage collector, which recycle all the unused memory and frees the memory and makes it available to the heap space. 7) What is Python decorator? A Python decorator is a specific change made within Python syntax to alter functions easily. 8) What are the rules for local and global variable in Python? In Python, variables that are only referenced inside a function are called implicitly global. If a variable is assigned a new value anywhere within the function's body, it's assumed to be a local. If a variable is ever assigned a new value inside the function, the variable is implicitly local, and you need to explicitly declare it as 'global'. 9) What is namespace in Python? In Python, every name has a place where it lives and can be hooked for. This is known as namespace. It is like a box where a variable name is mapped to the object placed. Whenever the variable is searched out, this box will be searched, to get corresponding object. 10) What are iterators in Python? In Python, iterators are used to iterate a group of elements, containers like list. 11) What is generator in Python? In Python, generator is a way that specifies how to implement iterators. It is a normal function except that it yields expression in the function. 12) What is slicing in Python?
  • 3. Slicing is a mechanism used to select a range of items from sequence type like list, tuple, string etc. 13) What is dictionary in Python? The built-in datatypes in Python is called dictionary. It defines one-to-one relationship between keys and values. Dictionaries contain pair of keys and their corresponding values. Dictionaries are indexed by keys. Let's take an example The following example contains some keys ? Country Hero & Cartoon. Their corresponding values are India, Modi and Rahul respectively. 1 >>> dict = {'Country': 'India', 'Hero': 'Modi', 'Cartoon': 'Rah ul'} 2 >>>print dict[Country] 3 India 4 >>>print dict[Hero] 5 Modi 6 >>>print dict[Cartoon] 7 Rahul 14) What is Pass in Python? Pass specifies a Python statement without operations. It is a place holder in a compound statement, where there should be a blank left and nothing has to be written there. 15) Explain docstring in Python? A Python documentation string is called docstring. It is used for documenting Python functions, modules and classes. 16) What is negative index in Python? Python sequences are indexed in positive and negative numbers. For example: 0 is the first positive index, 1 is the second positive index and so on. For negative indexes -1 is the last negative index, -2 is the second last negative index and so on. 17) What is pickling and unpickling in Python? Pickling is a process in which a pickle module accepts any
  • 4. Python object, converts it into a string representation and dumps it into a file by using dump() function. Unpickling is a process of retrieving original Python object from the stored string representation for use. Pickleis a standard modulewhich serializes and de-serializes a Python objectstructure. 18) How can you make forms in Python? You have to import cgi module to access form fields using FieldStorage class. Attributes of class FieldStorage for form: form.name: The name of the field, if specified. form.filename: If an FTP transaction, the client-side filename. form.value: The value of the field as a string. form.file: file object from which data can be read. form.type: The content type, if applicable. form.type_options: The options of the 'content-type' line of the HTTP request, returned as a dictionary. form.disposition: The field 'content-disposition'; None, if unspecified. form.disposition_options: The options for 'content- disposition'. form.headers: All of the HTTP headers returned as a dictionary. Example 1 import cgi 2 form = cgi.FieldStorage() 3 if not (form.has_key("name") and form.has_key("age")): 4 print "<H1>Name & Age not Entered</H1>" 5 print "Fill the Name & Age accurately." 6 return 7 print "<p>name:", form["name"].value 8 print "<p>Age:", form["age"].value 19)What are the differences between Python 2.x and Python 3.x? Python 2.x is an older version of Python. It is a legacy now. Python 3.x is newer. It is the present and future of this language. The most visible difference between them is in print statement. In Python 2 it is print ?Hello? and in Python 3, it is
  • 5. print (?Hello?). 20)How can you organize your code to make it easier to change the base class? You have to define an alias for the base class, assign the real base class to it before your class definition, and use the alias throughout your class. you can also use this method if you want to decide dynamically (e.g. depending on availability of resources) which base class to use. Example 1 BaseAlias = <real base class> 2 class Derived(BaseAlias): 3 def meth(self): 4 BaseAlias.meth(self)