Python | PYTHONPATH  PYTHONPATH is an environment variable that you can set to add additional directories where Python will look for modules and packages. This is especially useful in maintaining Python libraries that you do not wish …

Last updated 3 years, 7 months ago | 1443 views

Tags:- Python

Finalize method is used for freeing up the unmanaged resources and cleaning up before the garbage collection method is invoked. This helps in performing memory management tasks.

Last updated 3 years, 7 months ago | 1442 views

Tags:- Python

Django | Middleware  Middleware is something that executes between the request and response. In simple words, you can say it acts as a bridge between the request and response. Similarly In Django when a request is made …

Last updated 3 years, 7 months ago | 1441 views

Tags:- Django

Python has a multi-threading package, but commonly not considered good practice to use it as it will result in increased code execution time. Python has a constructor called the Global Interpreter Lock (GIL). The GIL ensures …

Last updated 3 years, 7 months ago | 1440 views

Tags:- Python

Python | Global, Local and Nonlocal variables Global variables are public variables that are defined in the global scope.  A variable declared inside the function's body or in the local scope is known as a …

Last updated 3 years, 7 months ago | 1436 views

Tags:- Python

Python | namedtuple A namedtuple will let us access a tuple’s elements using a name/label. We use the function namedtuple() for this, and import it from collections. >>> from collections import namedtuple #format >>> result=namedtuple('result','Physics Chemistry …

Last updated 3 years, 7 months ago | 1434 views

Tags:- Python

Python |  / and // Operator /: is a division operator and returns the Quotient value. e.g: 10/3  will return 3.33 // : is known as floor division operator and used to return only the value of …

Last updated 3 years, 7 months ago | 1433 views

Tags:- Python

Django | ORM ORM stands for Object-relational Mapper. Instead of interacting with the database by writing raw SQL queries and converting the data returned from the query into a Python object, ORM allows us to interact …

Last updated 3 years, 7 months ago | 1426 views

Tags:- Django

Python | Slicing  As the name suggests, ‘slicing’ is taking parts of sequences like lists, tuples, and strings. Syntax for slicing is [start : stop : step] The start is the starting index from where to slice a …

Last updated 3 years, 7 months ago | 1420 views

Tags:- Python

Python | ‘is’, ‘not’, and ‘in’ operators is: Returns True if both variables are the same object >>> x = 5 >>> y = 5 >>> z = 1 >>> x is y True >>> x …

Last updated 3 years, 5 months ago | 1419 views

Tags:- Python

List the inheritance styles in Django There are three possible inheritance styles in Django, and they are: Abstract Base Classes: This is used when we want to make the parent class hold the information which …

Last updated 3 years, 5 months ago | 1414 views

Tags:- Django

Python | Break, Continue, and Pass Break: The break statement terminates the loop immediately and the control flows to the statement after the body of the loop. Continue: The continue statement skips the current iteration of the statement, …

Last updated 3 years, 7 months ago | 1411 views

Tags:- Python

Python | Print String N times >>> s = 'Python' >>> n = 5 >>> print(s * n) PythonPythonPythonPythonPython  

Last updated 3 years, 4 months ago | 1410 views

Tags:- Python Django

The two static analysis tools used to find bugs in Python are Pychecker and Pylint. Pychecker detects bugs from the source code and warns about its style and complexity. While Pylint checks whether the module …

Last updated 3 years, 7 months ago | 1406 views

Tags:- Python

Django | Set up Database We need to edit the setting.py file present in the project, which contains all the settings related to the project. By default Django comes with an SQLite database; The  SQLite database …

Last updated 3 years, 5 months ago | 1403 views

Tags:- Django