Code Formatting

Just a note that there are two ways to format code on this forum. One way is to indent it all four spaces and separate it from other text by at least one newline on each side, like this:

def silly(code):
    print "Trix are for kids.", 2
    return

This works, however, I personally prefer the other method, putting three [grave accents]1 on either side of the code, similar to a multiline comment in Python. This way, you get syntax highlighting, and it’s easier to copy code over.

def silly(code):
    print "Trix are for kids.", 2
    return

Easier to use, easier to read. Give it a try.
[1]: https://www.google.com/search?client=ubuntu&channel=fs&q=grave+accent&ie=utf-8&oe=utf-8

1 Like

Yes, the three-grave method of code formatting produces much better results than the four-space method. We should all get with the grave method.

Thanx for the note, and especially for the silly function. :slight_smile: