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

Basic python programing

Rating
-
Sold
-
Pages
8
Uploaded on
16-04-2023
Written in
2004/2005

This document is all about python programing for beginners in coding

Institution
Course

Content preview

https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

1) What is Python? What are the benefits of using Python?

Python is a programming language with objects, modules, threads, exceptions and automatic
memory management. The benefits of pythons are that it is simple and easy, portable, extensible,
build-in data structure and it is an open source.

2) What is PEP 8?

PEP 8 is a coding convention, a set of recommendation, about how to write your Python code
more readable.

3) What is pickling and unpickling?

Pickle module accepts any Python object and converts it into a string representation and dumps it
into a file by using dump function, this process is called pickling. While the process of retrieving
original Python objects from the stored string representation is called unpickling.

4) How Python is interpreted?

Python language is an interpreted language. Python program runs directly from the source code. It
converts the source code that is written by the programmer into an intermediate language, which
is again translated into machine language that has to be executed.

5) How memory is managed in Python?

• Python memory is managed by Python 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.
• The allocation of Python heap space for Python objects is done by Python memory
manager. The core API gives access to some tools for the programmer to code.
• 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.



6) What are the tools that help to find bugs or perform static analysis?

PyChecker is a static analysis tool that detects the bugs in Python source code and warns about
the style and complexity of the bug. Pylint is another tool that verifies whether the module meets
the coding standard.

7) What are Python decorators?

A Python decorator is a specific change that we make in Python syntax to alter functions easily.

8) What is the difference between list and tuple?

, https://www.guru99.com
---------------------------------------------------------------------------------------------------------------------------------------------

The difference between list and tuple is that list is mutable while tuple is not. Tuple can be hashed
for e.g as a key for dictionaries.

9) How are arguments passed by value or by reference?

Everything in Python is an object and all variables hold references to the objects. The references
values are according to the functions; as a result you cannot change the value of the references.
However, you can change the objects if it is mutable.

10) What is Dict and List comprehensions are?

They are syntax constructions to ease the creation of a Dictionary or List based on existing
iterable.

11) What are the built-in type does python provides?

There are mutable and Immutable types of Pythons built in types Mutable built-in types

• List
• Sets
• Dictionaries

Immutable built-in types

• Strings
• Tuples
• Numbers

12) What is namespace in Python?

In Python, every name introduced 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.

13) What is lambda in Python?

It is a single expression anonymous function often used as inline function.

14) Why lambda forms in python does not have statements?

A lambda form in python does not have statements as it is used to make new function object and
then return them at runtime.

15) What is pass in Python?

Pass means, no-operation Python statement, or in other words it is a place holder in compound
statement, where there should be a blank left and nothing has to be written there.

Written for

Course

Document information

Uploaded on
April 16, 2023
Number of pages
8
Written in
2004/2005
Type
OTHER
Person
Unknown

Subjects

$6.09
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
sandeepofficial2006

Get to know the seller

Seller avatar
sandeepofficial2006
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
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