Reading Time: 1 minutesZen of Python Zen of Python The this module reveals a list of guidelines which the Python developers had in mind while developing the language. It encapsulates the philosophy that […]
Month: January 2017
Operator Precedence in Python
Reading Time: 1 minutesOperator Precedence in Python Operator Precedence in Python Following is the order in which operators in Python are evaluated. The operators at the top are evaluated first, and ones lower […]
Python: Duck Typing
Reading Time: 1 minutesDuck Typing in Python Duck Typing in Python Python allows the user to skip the data type of variables. It doesn't even require you to declare the return type of […]
Python: Docstrings
Reading Time: 1 minutesDocstrings in Python Docstrings in Python You can provide a helpful description of your functions, classes, modules in form of docstrings. Documentation strings need to be the first line of […]
Python: Unpacking Iterables into Individual Variables
Reading Time: 1 minutesUnpacking Iterables into Individual Variables in Python Unpacking Iterables into Individual Variables in Python In Python, iterable objects can be decomposed into individual components in a single statement. This is […]
Python: When to use which data structure
Reading Time: 1 minutesWhen to use which data structure in Python When to use which data structure in Python Each data structure has an array of associated methods and attributes, and each one […]
Python: Prettifying output with the builtin pprint module
Reading Time: 1 minutesPrettifying output in Python using pprint Prettifying output in Python using pprint The builtin pprint module enables the user to prettify the output while printing lists, tuples & dictionaries. This […]
Getting help from Python: Using the builtin function help()
Reading Time: 1 minutesUsing help() in Python Using help() in Python Python's builtin help() function returns the description of the object passed to it, in addition to its basic usage. For example, if […]
Exploring an object in Python: Using the builtin function dir()
Reading Time: 1 minutesUsing dir() in Python Using dir() in Python The dir(object) function returns a list of all the methods and associated with the mentioned object. Everything in Python is an object, […]
Python: The "if __name__ == '__main__':" construct
Reading Time: 2 minutesif __name__ == '__main__' if __name__ == '__main__' You may have encountered something like if __name__ == '__main__'. This if construct is used to execute the top-level code(i.e. at the […]

