On 22-Nov-2014 6:35 am, Dennis Lee Bieber wrote:
On Fri, 21 Nov 2014 10:35:19 +0200, Steve Hayes <hayes...@telkomsa.net>
declaimed the following:


This Python script does it for me.

year = input("Year: ")
age = input("Age: ")
born = year-age
print 'Year of birth:', born

It's so simple, so elementary, that it's not really worth writing about,
except for the fact that it illustrates the KISS principle.

        And it is wrong since it doesn't take into account the month.

        2014 - 55 => 1959

        But I was born in April of 1958, so any calculation done for
January/February/March (and the first week of April) is going to produce
the incorrect year (I /was/ 55 in January of 2014...)

--
        bieber.geneal...@earthlink.net          Dennis Lee Bieber       
        HTTP://home.earthlink.net/~bieber.genealogy/


Have a read of:

http://stackoverflow.com/questions/2217488/age-from-birthdate-in-python

Paul
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to