1. Explain PEP 8 in Python ?
PEP 8 is considered as a coding convention, a set of recommendation, about how to write your Python code more readable.
The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.
3.. How to convert string as a variable name in python?
The simplest way to convert string as a variable name is by using vars().
4. What is the use of Def keyword for method?
Answer:The Def keyword in python is used to form a new user-defined function. The def keywords mark the beginning of function header. The functions are the objects through which one can easily organize the code.
5.Can we use hybrid inheritance in Python?
No, python doesn’t support hybrid inheritance. But we can use straight method and round diamond method we can achieve it.
6. range vs xrange in Python?
In python the range and xrange are two functions that are used repeat number of time in for loops. The major difference between range and xrange is that the xrange returns the xrange object while the range returns a python list objects. The xrange is not capable for generating the static list at run-time. On the other hand range can do that.
You can make dynamic modifications to a module or class during the run-time. This process is called monkey patching in Python.
8.What is Flask in Python?
Flask, a microframework principally constructed for a minor application with easier requirements. External libraries must be used in Flask and flask is always ready to use state.
9.What is Pyramid in Python?
For larger application, you can make use of Pyramid and this is hefty configurable concept. Pyramid affords suppleness and permits the developer to employ the appropriate tools for their assignment.
10.What is Django in Python?
Similar to Pyramid, Django is built for larger applications and ORM is included.
11.What is the concept used in Python for memory managing?
Python private heap space is the one used to manage memory.
12. What is the use of split in Python ?Answer:
If you want to separate a provided string in Python, use split() function.
An inbuilt Python module helpful in creating GUI applications is known as Tkinter.
14.Explain multiple exception handling in python?Answer:
To handle multiple exception in python you can use try statement. You can also use these blocks:
- The try/except blocks
- The finally blocks
- The raise keywords
- Defining your own exception
A tuple is a group of specific data structure under Python is immutable. They mean similar to progressions, really prefer the lists. Also, that tuples follow parentheses as including, but these programs have square sections in their syntax.
16.What is the use of Isalpha() In Python?
Python has been provided that built-in isalpha() value function for each string manipulating purpose. It reflects the True value function if all types in this string value function are of alphabet type number, else value function it returns False.
17.What does the meaning of Slicing in python?
Python Slicing is defined as Lists of Tuples and Arrays Volume function. The Lists element function has a default bit fo the functionality while slicing. If there is a no consequence of before that first colon, it expects to begin at the start index of the list.
18.What is the use of beautifulSoup module in python?
We are using the module for pulling the data from HTML and XML files
19.What is TKIner in python?
TKIner is a python inbuilt library for developing the GUI
20.What is pip in python?
Pip is a python package installer. Whenever we need third party library like paramiko,pandas etc
We can use pip command to install the packages
Ex: pip install paramiko
21.What is pandas in python?
Pandas is data science library which deal with large set of data. pandas define data as data frame and processes it. Pandas is a third party library which we need to install.
22.What is decorators in python?
The decorators are special functions which will very useful when tweaking the function or class.it will modify the functionality of another function.
The type() will give you the information about data type and id() will provide you the memory location of the object
24.map vs filter in python?
Map and filter are called higher order functions which will take another functions as an argument.
25.Why a tuple is best over a list in python?
We can use tuple as a dictionary key because it is hash able and tuple accessing very fast compare to a list.
26.What is list in python?
A list is a mutable sequential data items enclosed with in and elements are separated by comma.
In a list we can store any kind of data and we can access them by using index
27.Difference between Pyramid and Django in python?
Both used for larger application and Django comes with a ORM framework.
28.Name the packages used in python
NUMPY, SCIPY, MATLAB, etc
29.Difference between pickling vs unpickling in python?
If the objects translated from string then it seems to be pickling
If the String is dumped to objects then it seems to unpickling.
30.Difference between args vs kwargs in python ?
It doesn’t know how many arguments are used.
It doesn’t know how many keywords are used.