


Get values as a list of dictionaries from a JSON object in Python
Let’s take the JSON above as an example. I need the values as a list of dictionaries in Python. This is how I did it.

Measure the execution time of a function in Python using decorators
We can use decorators to calculate the execution time of a function. Here the output is in milliseconds.

Capitalize the first letter of every word in the string using Python
In Python, title() function in String method returns a new string whose first letters are capitalized. In short, title() method returns a new title cased string from a string.


Invert a dictionary in Python
Inverting a dictionary basically means keys and values are swapped i.e keys become values and values become keys.



How to check if a list is empty in Python?
In this tutorial we discuss the various ways of checking if a list is empty in Python. len bool equal

How to remove last character from Python string?
We can use the slicing in Python to remove the last character from a string in Python.


Reverse a number including decimal points in Python
Source: 30 Seconds of Python



Check if a day is weekday or weekend in Python
To check if a day is weekday or weekend in Python, we basically get the day number using weekday() function and see if it’s > 4 or <4. Easy!


Shuffle a list using Fisher-Yates algorithm in Python
We have already discussed Fisher-Yates algorithm in detail, which is the perfect shuffling algorithm to exist.



Convert decimal to binary in Python
We can use bin() to convert a given decimal number into its binary equivalent.

Combine two lists into a dictionary in Python
Combines two lists into a dictionary, where the elements of the first one serve as the keys and the elements of the second one serve as the values.

Convert decimal to hexadecimal in Python
We can use hex() to convert a given decimal number into its hexadecimal equivalent.
