[Tutor] Program Questions

Alan Gauld alan.gauld at blueyonder.co.uk
Tue Jul 20 00:03:29 CEST 2004


In my mail tool they were the only bits that had any indentation at
all!
It would be useful if you can find a way to send plain text since
Python
indentation is critical, not to mention easier to read!

BTW Instead of

print '\n'
print 'foo'
print '\n'

its easier to do:

print '\nfoo\n'

or even

print '''
foo

'''

personally I'd go for the first option.

Where you need to substitute a function call use a format string:

print "\n%s\n" % acct.foo()

It keeps it shorter and easier to read.

As to the error, again it helps if you post the actual error report.

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list