[Tutor] What's the invalid syntax? Code supplied

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Aug 4 04:53:28 CEST 2005



On Wed, 3 Aug 2005, Nathan Pinno wrote:

> I forgot to add that it works because commas separate it into groups so that
> when the reads the file it has output, the program can split it into the
> site, ID, and passcard.


Hi Nathan,

Ok, it's good that we're looking back, because that's not right; commas
did not have to do with what was causing problems.  Let's look at the
buggy statement again.

    out_file.write(site+","+sitelist[site][0]+","+sitelist[site][1]"\n")

With fresh eyse, can you look back at how you corrected this?


If you think this my insisting on you seeing why things weren't working,
consider this: if it's an easy error to make (and it is an easy mistake to
make), you may want to spend some time to learn how to recognize the error
and its correction.  That way, you don't have to wait for folks on Tutor
to point things out for you.



More information about the Tutor mailing list