yield is a keyword beares the ability to turn any function into a generator.  Much like the standard return keyword, but returns a generator object. It is also true that one function may observe multiple …

Last updated 1 year, 9 months ago | 392 views

Tags:- Python

Python |  issubclass() This is done by using a method called issubclass() provided by python. The method tells us if any class is a child of another class by returning true or false accordingly.     …

Last updated 1 year, 10 months ago | 391 views

Tags:- Python

Python program to count the number of capital letters in a file. with open(FILE_NAME) as my_file: count = 0 text = my_file.read() for character in text: if character.isupper(): count += 1 print(count)    

Last updated 1 year, 7 months ago | 389 views

Tags:- Python

Using PDB we debug code in python. Some pdb commands include- <b> — Add breakpoint <c> — Resume execution <s> — Debug step by step <n> — Move to next line <l> — List source code …

Last updated 1 year, 9 months ago | 389 views

Tags:- Python

Python | Dogpile effect In case the cache expires, what happens when a client hits a website with multiple requests is what we call the dogpile effect. To avoid this, we can use a semaphore lock. When …

Last updated 1 year, 9 months ago | 388 views

Tags:- Python

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

Tags:- Python

Python | Memory manage Python has a private heap space to hold all objects and data structures. Being programmers, we cannot access it; it is the interpreter that manages it. But with the core API, …

Last updated 1 year, 9 months ago | 386 views

Tags:- Python

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 1 year, 9 months ago | 385 views

Tags:- Python

Django | Check Version  To check for the version of Django installed on your system, you can open the command prompt and enter the following command: python -m django –version You can also try to import …

Last updated 1 year, 9 months ago | 385 views

Tags:- Django

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

Tags:- Python

Django | Disadvantages  Django has the following disadvantages: Django's modules are bulky. It is completely based on Django ORM. Components are deployed together. We must know the full system to work with it.

Last updated 1 year, 9 months ago | 384 views

Tags:- Django

Django | NoSQL NoSQL basically stands for “not only SQL”. This is considered an alternative to the traditional RDBMS or relational Databases. Officially, Django does not support NoSQL databases. However, there are third-party projects, such as …

Last updated 1 year, 9 months ago | 382 views

Tags:- Django

You can do this by converting the list to a set using the set() method and comparing the length of this set with the length of the original list. If found equal, return True else …

Last updated 1 year, 7 months ago | 381 views

Tags:- Python

Python | __init__  constructor method __init__ is a constructor method in Python and is automatically called to allocate memory when a new object/instance is created. All classes have a __init__ method associated with them.   class Student: …

Last updated 1 year, 10 months ago | 381 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 1 year, 9 months ago | 380 views

Tags:- Python