[Tutor] Re: Program Questions (original) (raw)

Andrei project5 at redrival.net
Fri Jul 16 08:11:20 CEST 2004


Adelein and Jeremy <adeleinandjeremy yahoo.com> writes:

> You need quotes around string literals, pieces of text that were > never assigned a name. She did have quotes. This is what you apparently saw:

I saw no quotes in the message. Something odd going on with the editor?

This is what I saw (there are single quotes around each string literal): I see question marks in this one. Some encoding issue?

On to the original poster:

The code at http://rafb.net/paste/results/88yf5V76.html looks a lot better though. Except for the mismatched parens already mentioned (line 39 and 42), you're trying to subclass something called "base" in Account. This "base" doesn't exist - it's not a built-in and you haven't defined it. You should instead subclass object.

If you fix these issues, the program seems to work nicely. You might want to have a look at the lines using

str(time.strftime("%d %b %Y")) + '$' + str(amt)

I think you'd be better off pulling it out into a function and/or using a format string and certainly putting a space between the date and the amount.

Yours,

Andrei



More information about the Tutor mailing list