benvpatel at yahoo.com
Sun Feb 2 22:57:52 CET 2003
Thanks for your quick response.
I am trying to write a function which will take a String as an argument and add it to a hashtable. If the value entered is in the Hashtable then print it or else error out.
Here is what I have written so far :
#y = raw_input ("Please enter a String: ")
if len(y) > 1:
x[i] = i
x[i] = y
i = i+1
#print y, z
Any advice !
Laura Creighton <lac at strakt.com> wrote:> 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
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.
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list