[an error occurred while processing this directive] CSC108H/A08 Assignment 1 Rules

CSC108/A08 Assignment 1 Rules

In this course, you will be marked not only on whether your code works, but also on style. Here are some guidelines.

Formatting Style

  1. Use Python style conventions for your function and variable names (pothole case: lowercase letters with words separated by underscores (_) to improve readability).

  2. Choose good names for your functions and variables. For example, num_bright_spots is more helpful and readable than nbs.

  3. Use a tab width of 4 (Wingware's default), if you use tabs at all. The best way to make sure your program will be formatted correctly is never to mix spaces and tabs -- use only tabs, or only spaces.

  4. Put a blank space before and after every operator. For example, the first line below is good but the second line is not:

    b = 3 > x and 4 - 5 < 32
    b= 3>x and 4-5<32
  5. Write a docstring comment for each function. (See below for guidelines on the content of your docstrings.)

    Put a blank line after every docstring comment.

  6. Each line must be less than 80 characters long including tabs and spaces. You should break up long lines using \.

    In Wing, you can find out what column you are in by looking in the lower left-hand corner.


  1. The first line should contain:
    (parameter types) -> return type

  2. Describe precisely what the function does.

  3. Do not reveal how the function does it.

  4. Make the purpose of every parameter clear.

  5. Refer to every parameter by name.

  6. Be clear about whether the function returns a value, and if so, what.

  7. Explain any conditions that the function assumes are true. Examples: "n is an int", "n != 0", "the height and width of p are both even."

  8. Be concise and grammatically correct.

  9. Write the docstring as a command (e.g., "Return the first ...") rather than a statement (e.g., "Returns the first ...")

[an error occurred while processing this directive]