The questions are on purpose folded, so that you can try to answer them.
Python is general purpose, high level, interpreted, dynamically typed programming language.
Easy to learn, read and write, versatile, widely used, open source …
Languages which “guess” the exact type of a variable at run time are dynamically typed i.e. the programmer does not explicitly have to specify the type.
Languages which instead of compiling the program to machine code relies on an Interpreter to parse the program to intermediary format that this Interpreter understand and can execute i.e. on-the-fly execution.
The Scope is the boundary of variable visibility i.e. at what part of the code a variable is alive.
Lists are mutable Tuples and Tuples are immutable Lists. In Lists you can add,delete and update elements in Tuples you can’t.
Numbers (int,float), String, Boolean
Easy to use, Object oriented, have Functional features ( list comprehension, iterators, generators, map, filter, reduce), decorators
if, for, def, yield, class, …..
Literals and Values are synonymous. They include Numbers, Characters, Strings, Booleans.
(1,2) + (3,4)
Functions are defined using the def keyword outside of class. Also a function should return a value.
Because by default if you don’t use return, Python still returns None, so it is moot do you call this Function or Procedure.
Follow the Instructions from python.org site.
web development, numerical and symbol processing, machine learning …
Go over this page and also [Python FAQ].
Don’t try to memorize, try to understand.
Depends on what type of coding interview you are going.
Neither ! Both have strong and weak qualities.
C++ is better for System programming, faster programs
Python is better at Rapid App development, easier to use, lib packages
Python is better at Rapid App development, easy of use, lib packages
By default Python do not have arrays. Lists are used as substitute, because they support indexing and slicing.
On the other hand there is an array library in the default installation.
Arrays can’t grow and have to have homogeneous values i.e. values of the same type, but are faster than lists.
It is a method that allows accessing parts of list, tuples and strings. Ex.: lst[from:to:step]
Basically a function that returns a function.
Modules are used to group and organize your Python code. This makes it easier to understand and use.
Variables are used to store Values.
OOP is a method of encapsulating data and behavior together.
web development, numerical and symbol processing, machine learning …
iterator : API interface implementation that allows iteration over complex structures and classes.
generator : function that return a function
yield, yields control back to the caller like return, but at the same times remembers the place in the function where the interruption happens, so the next time you call it again it continues from this point outward.
In contrast every function call after return starts from the beginning.
Class is the description and implementation
Objects are the physical instantiation of the Class definition
Method is a function aware of Object variables/attributes
Attributes are variables belonging to a Class or an Object
Class variables are accessible by all the Objects instantiated from the Class
Object variables are accessible only to the object
@staticmethod decorator label a class method so that it can be called w/o instantiating object first. F.e. ClassName.method()
Method defined as @classmethod can be called by all objects of the class.
super() is used to access attributes or methods of parent classes