![]() |
1. Explain PEP 8 in Python ? Answer: PEP 8 is considered as a coding convention, a set of recommendation, about how to write your Python code more readable. |
Answer:
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?
Answer:
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?
Answer:
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?
Answer:
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.
Answer:
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?
Answer:
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?
Answer:
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?
Answer:
Similar to Pyramid, Django is built for larger applications and ORM is included.
11.What is the concept used in Python for memory managing?
Answer:
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
- Assertions
- Defining your own exception
Answer:
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?
Answer:
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?
Answer:
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?
Answer:
We are using the module for pulling the data from HTML and XML files
19.What is TKIner in python?
Answer:
TKIner is a python inbuilt library for developing the GUI
20.What is pip in python?
Answer:
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?
Answer:
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?
Answer:
The decorators are special functions which will very useful when tweaking the function or class.it will modify the functionality of another function.
Answer:
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?
Answer:
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?
Answer:
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?
Answer:
A list is a mutable sequential data items enclosed with in[] and elements are separated by comma.
Ex: var_list=[5,5.2,’nishant’,’Besant’,[6,9,5]]
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?
Answer:
Both used for larger application and Django comes with a ORM framework.
28.Name the packages used in python
Answer:
NUMPY, SCIPY, MATLAB, etc
29.Difference between pickling vs unpickling in python?
Answer:
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 ?
Answer:
Args:
It doesn’t know how many arguments are used.
Kwargs:
It doesn’t know how many keywords are used.