How is this related to web2py? This is not a "we solve your homework" news group. If you really expect help, try a more general-purpose newsgroup like comp.lang.python, and make sure you post your version of the code, pointing out where you are stuck, otherwise you might get very rude replies :)
--

