MRO stands for Method Resolution Order. Talking of multiple inheritances, whenever we search for an attribute in a class, Python first searches in the current class. If found, its search is satiated. If not, it …

Last updated 1 year, 10 months ago | 438 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, 10 months ago | 386 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, 10 months ago | 383 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, 10 months ago | 414 views

Tags:- Python

Python | Iterator | (__iter__ and __next__) Iterators are objects that can be iterated upon. The iterator protocol for Python declares that we must make use of two functions to build an iterator- iter() and next().   …

Last updated 1 year, 10 months ago | 551 views

Tags:- Python

Python | Exception Handling Python has many built-in exceptions that are raised when your program encounters an error. Try and Except Statement – Catching Exceptions: Try and except statements are used to catch and handle …

Last updated 1 year, 10 months ago | 544 views

Tags:- Python

Primitive data types are Integers, Float, Strings, and Boolean. Non-primitive data types are Array, List, Tuples, Dictionary, Sets, and Files.    

Last updated 1 year, 10 months ago | 403 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, 10 months ago | 406 views

Tags:- Python

Python | new_style and old_style Old-style: With old-style classes, class and type are not quite the same things.  If obj is an instance of an old-style class, obj __class__ designates the class, but the type(obj) is always …

Last updated 1 year, 10 months ago | 377 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, 10 months ago | 393 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, 10 months ago | 399 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, 10 months ago | 396 views

Tags:- Python

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

Tags:- Python

Python | append() and extend() Function Both append() and extend() methods are methods used to add elements at the end of a list. append(element): append() method adds the given element at the end of the list. …

Last updated 1 year, 10 months ago | 377 views

Tags:- Python

Python | map() Function The map() function executes a specified function for each item in an iterable. The map() function in Python has two parameters, function and iterable. The map() function takes a function as an argument and …

Last updated 1 year, 10 months ago | 419 views

Tags:- Python