Uncategorized

Convert timedelta to seconds in Python

This article will discuss how we can convert the datetime module’s timedelta object to total seconds in python. A little insight about the problem in hand, In the datetime module, the datetime.timedelta represents the difference between two dates, time, or datetime objects. For example, we have two timestamps as datetime objects, If you want the …

Convert timedelta to seconds in Python Read More »

Python: Delete specific characters from a string

In this article, we will discuss different ways to remove specific characters from a string in python. For example, we have a string, And we want to delete all occurrences of some specific characters from the string. These specific characters are, ‘&’ ‘#’ ‘@’ ‘!’ ‘;’ ‘,’ ‘:’ ‘\” After removing these specific characters from …

Python: Delete specific characters from a string Read More »

Python- Find the largest file in a directory

In this article, we will discuss how to find the largest file in a directory and its sub-directories using python. Table of contents Find the largest file in a directory using python. Find the largest file in a directory and its sub-directories using python. Get the largest file in a directory using python In python, …

Python- Find the largest file in a directory Read More »

Using STL to verify brackets or parentheses combination in an expression

In this we will see how to check if a given string take valid combination of open and close brackets i.e. (4+{8-[22+8]*}] contains valid order of open and close brackets. ({5+8]) contains invalid combination of open and close brackets. [showads ad=inside_post] Bracket combinations to be used, { , } [,] (,) Algo Used:   Create a empty stack of characters Traverse …

Using STL to verify brackets or parentheses combination in an expression Read More »

Scroll to Top