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 1 year, 8 months ago | 399 views

Tags:- Django

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 1 year, 11 months ago | 399 views

Tags:- Python

Python | Pass Statement The pass statement is used as a placeholder for future code. It represents a null operation in Python. It is generally used for the purpose of filling up empty blocks of …

Last updated 1 year, 11 months ago | 397 views

Tags:- Python

Django | Session Framework Using the session framework, you can easily store and retrieve arbitrary data based on the pre-site-visitors. It stores data on the server side and takes care of the process of sending and …

Last updated 1 year, 10 months ago | 395 views

Tags:- Django

Python | *args and **kwargs  *args is a special syntax used in the function definition to pass variable-length arguments. e.g: myFun(*argv) def func(*args): for i in args: print(i) func(2,3,4) #Output 2 3 4   **kwargs is …

Last updated 1 year, 11 months ago | 394 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 1 year, 11 months ago | 394 views

Tags:- Python

Python | What are decorators A decorator in Python is a function that modifies the behavior of an existing function or class without any modification to the original source code.  A decorator takes another function as its argument and returns yet …

Last updated 1 year, 8 months ago | 387 views

Tags:- Python

Python | filter(), map(), and reduce() Functions filter()  function accepts two arguments, a function and an iterable, where each element of the iterable is filtered through the function to test if the item is accepted or …

Last updated 1 year, 11 months ago | 387 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 1 year, 11 months ago | 386 views

Tags:- Python

Python | What are unit tests Unit test is a testing technique to check a single component of code and ensures that it performs as expected. Unit tests are an important part of regression testing to ensure that …

Last updated 1 year, 8 months ago | 385 views

Tags:- Python

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 1 year, 10 months ago | 384 views

Tags:- Python

Python | Main Function In the world of programming languages, the main is considered as an entry point of execution for a program. But in python, it is known that the interpreter serially interprets the file …

Last updated 1 year, 11 months ago | 384 views

Tags:- Python

The answer here is no. The modules with circular references to other objects, or to objects referenced from global namespaces, aren’t always freed on exiting Python. Plus, it is impossible to de-allocate portions of memory …

Last updated 1 year, 11 months ago | 384 views

Tags:- Python

Python | Module and Package Module: The module is a simple Python file that contains collections of functions and global variables and with having a .py extension file. It is an executable file and to organize all …

Last updated 1 year, 11 months ago | 383 views

Tags:- Python

Python | Deep and Shallow copies Shallow copy does the task of creating new objects and storing references to original elements. This does not undergo recursion to create copies of nested objects. It just copies the …

Last updated 1 year, 11 months ago | 382 views

Tags:- Python