[Tutor] Help needed with Python programming

Danny Yoo dyoo at hashcollision.org
Tue Apr 22 21:37:24 CEST 2014


Unfortunately, we can't give too much specific help on your particular
problem because it's homework.

You should use the knowledge you learned in your introductory
programming class about designing programs.  In particular, give a
name to the function or functions your are designing.  Be rigorous in
the terms you are using when you talk about the problem.  Formalize
what the types of inputs and outputs are.  Probably most importantly,
express test cases that will demonstrate what you want the output to
be.  And not hand-wavy things, but actual test cases that you can
execute.


What's the expected result of parsing the first line?  That is, you're
saying that the string:

   "1,3,5,0.03"

has some kind of meaning that can be parsed.

Can you express this meaning as a data structure?  Can you give that
data structure a name?

Can you write a unit test that can test that your parser is behaving properly?


More information about the Tutor mailing list