Reading Time: 1 minutesNaming Slices in Python Naming Slices in Python The constructor of the builtin slice class creates a slice object, which can be used in places where a slice is normally […]
Month: January 2017
IPython: An enhanced interpreter
Reading Time: 2 minutesIPython in Python IPython in Python IPython is a third-party interactive interpreter which has an array of features lacking in the original interactive interpreter of Python. It provides a browser-based […]
Python: When to use repr() & str() functions
Reading Time: 1 minutesrepr() & str() in Python repr() & str() in Python The builtin repr() function returns a string containing the printable representation of an object. Each Python object, be it lists, […]
Python: Collecting arguments passed to a Python script
Reading Time: 1 minutesCollecting arguments passed to a Python script Collecting arguments passed to a Python script The builtin sys module exposes objects used or maintained by the Python interpreter. One of these […]
Python: Getting size of an object in memory
Reading Time: 1 minutesGetting size of an object in memory in Python Getting size of an object in memory in Python The getsizeof() function of sys module tells us about the size of […]
Object Oriented Python: Using the __str__() magic method
Reading Time: 1 minutesUsing __str__() in Python Using __str__() in Python Like the __init__() method, the __str__() method is one of several class methods which are called implicitly on certain events. These methods […]
Object Oriented Python: Using the __init__() magic method
Reading Time: 1 minutesUsing __init__() in Python Using __init__() in Python The __init__ method is one of several class methods which are called implicitly on certain events. These methods are called magic methods, […]
Python: Interchanging Data Structures
Reading Time: 1 minutesInterchanging Data Structures in Python Interchanging Data Structures in Python You can make any data structure from any other data structure using the builtin constructors list(), tuple(), dict(), set(), frozenset() […]
Python: Using builtin chr() & ord() functions
Reading Time: 1 minutesUsing chr() & ord() in Python Using chr() & ord() in Python The ord() function takes a single character (special ones too) and returns its Unicode value. Unicode is a […]
Object Oriented Python: Naming Convention of Variables/Attributes
Reading Time: 1 minutesNaming Convention of Variables/Attributes in Python Naming Convention of Variables/Attributes in Python There are 4 conventions followed while naming variables in Python: Dunder attributes/Magic attributes such as __doc__, __name__ etc. […]

