Python Interview Question Solutions
Python Interview Question Solutions
Python
- Python has large library support for Machine Learning, Deep Learning and WebApp development
- Python supports many file formats like xml, JSON, txt, csv, excel, etc
R programming
- R is not ideal for Big Data because all data needs to be together.
- R is difficult to learn
- R version updates sometimes doesnt come with backword compatibility of codes, so version
updates may break R scripts very easily
- R is scripting language
Q Explain Difference between list and tuple
There is else block. It is optional. It is used when no exception occurs in try block
Also, there is finally block. It is optional. It is used to perform operations which needs to be
completed in both cases, either exception or no exception. For example in finally block we write
code to free resources like files, memory, database connections.
Q Explain set operators in Python ( like union, union all, minus, intersect)
A set is a collection of unordered elements. Each element must be distinct and immutable.
In a set element can of type bool, int, float, complex, tuple, frozen-set
Operations in set
discard(): removes given element from set. Doesn’t throw exception if element is not present
remove():removes given element from set. Throws exception if element is not present
union() : union of two sets is the set of all the elements, without duplicates, contained in either or
both of the sets. We can do this using | operator
intersection() : intersection of two sets is the set of all the elements that are common to both sets.
We do this using & operator.
difference():difference between the two sets is the set of all the elements present in the first set but
not in the second. We do this using - operator
symmetric_difference(): it selects all items in both sets without common elements in both sets.
Q Explain use of python in your project. Explain code of your project line by line.
Ans : Show your project code
If you have used libraries, then discuss how you have written code to use the libraries.
Preferably discuss user defined functions which you have written yourself