Pranav Indukuri has Published 49 Articles

How to get the total number of leap days in the years within range in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 08-Sep-2022 07:34:47

430 Views

In this article we will discuss how to find the number of leap years in a specified ranges of year in python. leapdays() The calendar module offers more helpful calendar-related tasks in addition to allowing calendars to be produced like programmes. The idealised calendar used by the functions and classes ... Read More

How to convert time seconds to h:m:s format in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 08-Sep-2022 07:22:02

6K+ Views

In this article, we will discuss various ways to convert time in seconds to H M S format in python. H M S format means Hours: Minutes: Seconds. Using arithmetic operations (Naïve method) In this method, we use mathematic calculations to convert time in seconds to h m s format. ... Read More

How to convert Python date format to 10-digit date format for mysql?

Pranav Indukuri

Pranav Indukuri

Updated on 08-Sep-2022 06:59:26

1K+ Views

In this article, we will convert a python date format to 10-digit format for MySQL. We use the mktime() method from the time module provided by python. The mktime() method The python time method mktime() is the inverse function of the localtime(). The time.mktime() method of the Time module is ... Read More

How to convert pandas offset to Python date?

Pranav Indukuri

Pranav Indukuri

Updated on 07-Sep-2022 07:02:26

480 Views

In this article, we convert the pandas offset to date in python. When you subtract the pandas from a date object, you get a pandas Timestamp object. You can convert this object to a String format date or Date object(Standard Python date). Or you can use the timedelta object from ... Read More

How do we compare Python Dates?

Pranav Indukuri

Pranav Indukuri

Updated on 05-Sep-2022 10:22:28

705 Views

In this article, we will understand how to compare python dates. They are different methods to identify which date is greater or lesser and these methods will be explored in detail. Using the timedelta() method and operator In this method, we use the datetime module and operator to ... Read More

How to check if a key exists in a Python dictionary?

Pranav Indukuri

Pranav Indukuri

Updated on 05-Sep-2022 10:16:15

1K+ Views

A dictionary maintains mappings of unique keys to values in an unordered and mutable manner. In python, dictionaries are a unique data structure, and the data values are stored in key:value pairs using dictionaries. Dictionaries are written with curly brackets and have keys and values. Dictionaries are now ordered as ... Read More

How to remove all the elements of a dictionary in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 05-Sep-2022 10:12:22

2K+ Views

A dictionary is a Python is a container that maintains mappings of unique keys to values in an unordered and mutable manner. Data values are stored in key:value pairs using dictionaries. Dictionaries are written with curly brackets and have keys and values. Dictionaries are now ordered as of Python 3.7. ... Read More

Why do you think tuple is an immutable in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 05-Sep-2022 09:16:38

4K+ Views

In this article, we will discuss why tuples in python are immutable. Before moving on, we will understand tuples in detail. Tuple Tuples are a data type that belongs to the sequence data type category. They're similar to lists in Python, but they have the property of being immutable. We ... Read More

How does the 'in' operator work on a tuple in Python?

Pranav Indukuri

Pranav Indukuri

Updated on 05-Sep-2022 09:09:39

1K+ Views

In this article, we discuss about the ‘in’ operator and how it works on tuples in python. Before moving on, we will discuss about tuples first. Tuple Tuples are a data type that belongs to the sequence data type category. They're similar to lists in Python, but they have the ... Read More

Advertisements