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 39 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

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

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 do I find out the sum of digits of a number in Python?

Hi, good question. If you are considering ...READ MORE

how can i randomly select items from a list?

if you google it you can find. ...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?

can you give an example using a ...READ MORE

Lowercase in Python

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

+1 vote