Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Interview questions

Rating
-
Sold
-
Pages
5
Uploaded on
14-05-2023
Written in
2022/2023

Interview questions based on python language

Institution
Course

Content preview

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 asimple yet powerful
programming language. It can run equally on different
platforms such as Windows, inux, 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?
InPython, variables that are only referenced inside a function
are called implicitly global. Ifa 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?
InPython, every name has a place where 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?

Written for

Course

Document information

Uploaded on
May 14, 2023
Number of pages
5
Written in
2022/2023
Type
OTHER
Person
Unknown

Subjects

$20.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
srirampandian

Get to know the seller

Seller avatar
srirampandian SRM University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions