Caculate age

Laura Creighton lac at strakt.com
Sat Feb 1 18:09:02 EST 2003


> Hi:
> 
> I am new at Python. I have an assignment to be written by tomorrow in Python.
> - Calculate a person's age based on a brithdate in any format
> 
> Any help will be appreciated.
> 
> Thanks in advance
> 
> Ben
> -- 
> http://mail.python.org/mailman/listinfo/python-list

I assume that you have a program that works to calculate a person's
age based on _some_ format.  If you cannot do that, then you need to
learn Python, period, and while learning Python is fast, I don't
know if it is that fast.  http://www.hetland.org/python/instant-python.php
is probably your best bet at trying to learn Python overnight, unless
you are already an experienced programmer where 'Dive into Python'
at http://diveintopython.org/ might suit you better.  One day is
still probably asking a lot.

But assuming that you have a program that works for some valid date,
the hard thing about this assignment is the 'any format' part.  This
sort of thing is best done with unit tests, and as part of the
http://diveintopython.org/ reference you get 
'http://diveintopython.org/roman_divein.html' which explains how you
do this, with examples for converting numbers from 1-3999 into their
Roman Numeral equivalents.  While this is the right way to do things,
it is quite possible that it has nothing to do with how your teacher
desires you to solve your assignment, which means you could be
100% correct and still get a rotten mark, which would stink.

Good luck,
Laura Creighton





More information about the Python-list mailing list