Reading Time: 1 minutesUsing any() & all() in Python Using any() & all() in Python Python provides two useful functions to check for true values of an iterable object. The any() function returns […]
Python
Python: Using builtin functions globals(), locals(), vars()
Reading Time: 1 minutesUsing globals(), locals() & vars() in Python Using globals(), locals() & vars() in Python globals() The builtin globals() function returns a dictionary containing objects accessible anywhere in the program. locals() […]
Python: Creating Secure Hashes/Message Digests using hashlib module
Reading Time: 1 minutesCreating Secure Hashes/Message Digests in Python using hashlib module Creating Secure Hashes/Message Digests in Python using hashlib module The builtin hashlib module provides an interface to create secure hashes/message digests […]
Python: Using the nonlocal keyword
Reading Time: 1 minutesUsing the nonlocal keyword in Python Using the nonlocal keyword in Python The nonlocal keyword is used when you are dealing with variables with same name but in different scopes. […]
Python: Returning values from a function - The return keyword
Reading Time: 1 minutesreturn in Python return in Python The return statement makes the control exit from a function, with an optional expression. A return statement without an expression is as good as […]
Python: Retrieving Most Frequent Elements in an Iterable
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 […]
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 […]