python

python

Python program to create one list from set and dictionary

In this quick python tutorial, we will learn how to create one list from one set or dictionary. A set can keep only unique elements and dictionary holds key-value pairs.

Read
python

Find the number of days between two dates in Python

Find out the difference between two dates in days using python. For example, if the first date is 2-2-2020 and the second date is 2-3-2020 in day-month-year format, this should print 29 days as the output.

Read
python

lgamma function of Python math

lgamma function is defined in python math module. It is used to find the natural logarithm of the absolute value of the gamma function for an argument. This function is available for python 3.2 and above.

Read
python

Python program to calculate compound interest

Compound interest is an interest calculation process that calculates the interest based on the initial principal and accumulated interests on a compounding period. Interest is added to the principal and for the next period, interest is gained on the accumulated interest.

Read
python

How to calculate combination in Python

Combination is the selection of set of elements from a collection, without regard to the order. For example, for the numbers 1,2,3, we can have three combinations if we select two numbers for each combination

Read
python

How to calculate permutation in Python

Python provides one utility method to find out the permutation of a iterable. This method is defined in itertool package. We can import this package and find out the permutation of any iterable like a dictionary, set or list elements.

Read
python

How to sort all files in a folder in Python

Python os module provides us listdir function to list all files in a directory or folder. We need to pass the directory path to this function and it returns us the name of all entries in that folder. This function is defined as below :.

Read
python

Python modulo explanation with example

Python modulo explanation with example

Read
python

What is __init__ in Python

If you know how to create python class and objects, you must have seen init method before. For the first comers, this looks different than other methods and classes. In this blog post, I will explain to you what is init and when/how to use it with different examples. Go through the tutorial and drop a comment below if you have any queries.

Read
python

Python program to find the area and perimeter of a rectangle

Python program to find the area and perimeter of a rectangle. This python program will take the values as inputs from the user and prints out the final results.

Read