I want to find the number of days between any given two dates. How can I do this in Python?
May 30, 2018 in Python 403 views

## 1 answer to this question.

You can use the date module to do this -

```from datetime import date

d1 = date(2012, 5, 22)
d2 = date(2018, 5, 26)
delta = d2 - d1
print(delta.days)```
answered May 30, 2018 by
• 4,260 points

## Write a Python program that takes as input a month and year, determines how many days are in the month, and outputs the number of days. Thirty days are in September, April, June, and November

Write a Python program that takes as ...READ MORE

## How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

## Print the odd and even factors of a number in Python

x = int(input("Enter any number \n")) print("The factors ...READ MORE

–1 vote

## How to filter out any digit that contains odd number in a range of number in Python?

n = list(range(10)) b = list(filter(lambda i:i%2!=0,n)) print(b) READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

## how do i use the enumerate function inside a list?

Enumerate() method adds a counter to an ...READ MORE

## Lowercase in Python

You can simply the built-in function in ...READ MORE

+1 vote