Interview Python Questionare
Interview Python Questionare
Benifits of python?
What is MVC? : design pattern commonly used in software development to organize the
structure of an application,
What is oope
-----------------------------------------------------------------------------------
-
Inheritance - Inheritance allows a new class to reuse code from an existing class.
The new child class inherits attributes and behaviors from the parent class
1. interperted pro language => source code wont be converted to mechine language
therefore no compilation and direct execution
2. Static - Data Types are checked before execution.
Dynamic - Data Types are checked during execution.
Python is an interpreted language, executes each statement line by line and thus
type-checking is done on the fly, during execution. Hence, Python is a Dynamically
Typed Language.
4. Lists and Tuple are sequece type in python , list is mutable and tuple is
immutable and lists are represented in squire brackets and tuple is represented in
parnthasis
5.DATATYPES
Int
float
str
bool
list
tuple
dict
set
None
complex
6. global variables are declared outside class and function , so its scope is
throughout the program , there for it can be accessed from anywhere in the program
protected attributs is meant to be used within the class and its subclass but it
can be accessed outside the class , it is represented with a leading underscore
private is strictly used inside the class and it is repreesented with double
leading underscore
7. Self is used to represent the instance of the class. With this keyword, you can
access the attributes and methods of the class in python.
3.INIT => Use the __init__() function to assign values to object properties, or
other operations that are necessary to do when the object is being created
4. The __str__() function controls what should be returned when the class object
is represented as a string.
5. The self parameter is a reference to the current instance of the class