Reading Time: 1 minutesMaking a variable global in Python Making a variable global in Python There will be instances where you are declaring an object inside a confined piece of code, and you […]
Month: January 2017
Python: Using builtin functions isinstance() & issubclass()
Reading Time: 1 minutesUsing isinstance() & issubclass() in Python Using isinstance() & issubclass() in Python isinstance() The builtin function isinstance(obj, cls) returns True if obj is an instance of class cls, else returns […]
Python: Enumerating with enumerate()
Reading Time: 1 minutesenumerate() in Python enumerate() in Python It is sometimes needed to have an index counter for elements of an iterable object. Python's builtin enumerate class enables us to do just […]
Python: Lambda Expressions (Anonymous functions)
Reading Time: 1 minutesLambda Expressions in Python Lambda Expressions in Python Lambda expressions(a.k.a. lambda forms) in Python are used to create anonymous functions. In a nutshell, these functions do not have the def […]
Python: Installing external modules using pip
Reading Time: 2 minutespip in Python pip in Python Python comes with many useful modules out-of-the-box. In addition to these modules, there is a large library of third-party modules which Python developers have […]
Python: Augmented Assignments
Reading Time: 1 minutesAugmented Assignments in Python Augmented Assignments in Python There are cases when you are storing the result of a binary operation into one of the operands. For example, a = […]
Python: Using semi-colon (;) to delimit statements in a suite
Reading Time: 1 minutes; in Python ; in Python Python uses new-lines as statement delimiters. This is in contrast to many contemporary languages which use semi-colons to delimit statements. However, Python also allows […]
Class Methods & Static Methods in Python: @classmethod & @staticmethod
Reading Time: 2 minutes@classmethod & @staticmethod in Python @classmethod & @staticmethod in Python Class Methods: @classmethod In Object Oriented Python, an instance method perceives its argument as the object on which the method […]
Python: Comparing two objects: Equality & Identity
Reading Time: 1 minutesEquality & Identity in Python Equality & Identity in Python While comparing two objects, there are two things to consider. One, whether the two objects refer to the same object […]
Python: Generating random elements with the random module
Reading Time: 1 minutesGenerating random elements with the random module in Python Generating random elements with the random module in Python The standard library called random helps the user to inject simulation into […]

