Reading Time: 1 minutesRetrieving Most Frequent Elements in an Iterable in Python Retrieving Most Frequent Elements in an Iterable in Python The Counter class of builtin module collections creates a dictionary of all […]
Month: January 2017
Python: Changing Data Types - Type Casting
Reading Time: 1 minutesChanging Data Types - Type Casting in Python Changing Data Types - Type Casting in Python Python identifiers do not carry any information about their type while declaration. As soon […]
Python: Asserting values using assert keyword
Reading Time: 1 minutesAsserting values using assert keyword in Python Asserting values using assert keyword in Python It's hard to argue with the fact that all practical programs have bugs. It is better […]
Python: Terminating your program
Reading Time: 1 minutesTerminating your program in Python Terminating your program in Python In order to exit from a Python script/Interactive Interpreter Session/Command Prompt Session, any of the following functions can be used: […]
Python: Importing Modules - 4 types of imports
Reading Time: 1 minutesImporting Modules in Python Importing Modules in Python A Module(or package as they are referred as in other languages) is a collection of code accessible using an import statement. Simply […]
Python: Using the builtin function range()
Reading Time: 1 minutesUsing range() in Python Using range() in Python In a lot of situations, you may feel the need to obtain a list of numbers, such as in for loop. The […]
Python: Using the with keyword
Reading Time: 1 minutesUsing with keyword in Python Using with keyword in Python The with keyword automatically shuts down resources as soon as the code block following it is executed. It is considered […]
Python: Using the pass keyword
Reading Time: 1 minutesUsing pass keyword in Python Using pass keyword in Python Code-blocks in Python are separated by indents and not by curly braces ( {} ). In cases where you don't […]
Python: Slicing a sequence
Reading Time: 1 minutesSlicing in Python Slicing in Python Slicing means getting a portion of an ordered sequence. An ordered sequence is a sequence whose elements can be accessed using indexes. Examples of […]
Python: Using the builtin print() function
Reading Time: 2 minutesUsing print() function in Python Using print() function in Python Every programmer is familiar with the builtin print() function. It's used to producing output onto the console, whether it's the […]

