Prepare yourself for an interview and Go with Confidence👍
A thread🧵💕
It is a programming language with objects, modules, threads, exceptions and automatic memory mgt. The benefits of pythons are that it is simple and easy, extensible, build-in data structure and it is open-source.
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.
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.
Mutable built-in types
🔶 List
🔷 Sets
🔶 Dictionaries
Immutable built-in types
🔷 Strings
🔶 Tuples
🔷 Numbers
In Python, every name introduced has a place where it lives and can be hooked for. This is known as a namespace. It is like a box where a variable name is mapped to the object placed.
PyChecker is a static analysis tool that detects the bugs in Python code and warns about the style and complexity of the bug. Pylint is another tool that verifies whether the module meets the coding std.
A Python decorator is a specific change that we make in Python syntax to alter functions easily.
They are syntax constructions to ease the creation of a Dictionary or List based on existing iterable.
It is a single expression anonymous function often used as an inline function.
A lambda form in python does not have statements as it is used to make new function object and then return them at runtime.
Pass means, no-operation Python statement, or in other words, it is a place holder in a compound statement, where there should be a blank left and nothing has to be written there.
In Python, iterators are used to iterate a group of elements, containers like a list.
A unit testing framework in Python is known as a unit test. It supports sharing of setups, automation testing, shutdown code for tests, aggregation of tests into collections etc.
A mechanism to select a range of items from sequence types like list, tuple, strings etc. is known as slicing.
The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.
A Python documentation string is known as docstring, it is a way of documenting Python functions, modules and classes.
i. 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 access to this private heap and interpreter takes care of this Python private heap.
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.
Pickle module accepts any Python object and converts it into a string representation, this process is called pickling. While the process of retrieving original Python objects from the stored string representation is called unpickling.
PEP 8 is a coding convention, a set of recommendation, about how to write your Python code more readable.
All the best👍