how many days in one year ?

Pavel Anossov anossov at gmail.com
Sun Apr 22 05:44:15 EDT 2012


import calendar

print 366 if calendar.isleap(2003) else 365



On 22 April 2012 13:37, contro opinion <contropinion at gmail.com> wrote:
> i want to know how many days in one year,
> import time
> import datetime
> d1= datetime.datetime(2003, 1, 1)
> d2=datetime.datetime(2003, 21, 31)
> print  (d2-d1).days+1
>
> i can get there are 365 days in the 2003,
>
> is there other way,better way  to calculate  ?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
С уважением, Аносов Павел



More information about the Python-list mailing list