Assignment Style Guidelines

The following simple rules are required for all i206 programming assignments. You must follow these conventions to receive full credit on your assignments. (Don’t worry, these are easy and should make everyone’s lives easier).

1. The first line of all of your python programs must be:

#! usr/bin/env python

(The #! part is known as the “shebang”). You must include it because it allows us to run your assignments unambiguously from a command line. (i.e.: fewer headaches for everyone).  It’s also considered good form.

2. Set your first and last name in the __author__ special attribute at the top of each python file you hand in (required so we know who you are). (See the example identification section below for what it should look like).

3. Set your email in the __email__ special attribute (required so we can contact you).

4. Set your python version in the __python_version (private) attribute. You can discover your python version by typing this at the command line:

python --version

Or by typing this at the command line:
>>>import sys
>>>print sys.version

5. __can_anonymously_use_as_example specifies whether or not we can use your code, (or portions of your code) anonymously on the course blog or during in-class code reviews. Sharing your code helps everyone learn. If you do NOT want us to use your code anonymously (or otherwise), set this variable = False (see example). Otherwise, set it to True. Or omit it, and we will assume you “opt- in” (which we hope you will do).

Example header of a python program:
#! /usr/bin/env python

__author__ = 'Emily Wagner'
__email__ = ''
__python_version = '2.6.4'
__can_anonymously_use_as_example = True

6. Use descriptive variable names in your programs (never use single letter names except for loop iterators). (This makes it easier for us to follow your logic and potentially grant partial credit).

7. Please limit your lines of code to 80 characters in width (or 80 columns) when possible. This allows for a clean hardcopy printout.

8. You must include sample output from your program when you hand it in. Do not forget!

9. Do your best to abide by PEP 8 style guidelines: Following them is not required, but we strongly encourage their use. (Following them will make your code look professional and will also make your graders lives much easier.)

10. Files must be named according to the following convention:

<course>_<assignment>_<doc_type>_<ischool_user_id>.py [all lowercase]


  • # Source code for Emily’s assignment #1
  • i206_a1_output_emily.txt # output for a1 (what happens when the program runs)
  • i206_a1_other_emily.(.txt|.pdf |.etc..) # any other files

If you are handing in more than one file, you increment an identification number:


11. Use the file upload utility to submit your work. If you upload the same file more than once, only the last uploaded version will be stored. If, for some reason the upload utility does not work for you, email all TAs and cc the professor.

12. You must NOT use any 3rd party/external libraries or modules as part of your source code for any of your coding assignments. Please restrict yourself to using modules in the Python Standard Library for your assignments unless the assignment’s text overrides this. (This sets an even playing-field among students. It also allows freedom in your coding, while still focusing you on course learning goals. We hope this focus will help you to build confidence for when you work with libraries/modules after 206)

Important: We will use the last-modified time of your most recently uploaded file as the timestamp for determining early/on-time/late submissions. For example, if you upload all your files more than 24 hours early, but uploaded a revised README file within 24 hours of the deadline, you will not qualify for early submission bonus.

Important: If not otherwise specified, all assignments are due by 10:30AM on the due date.

Thanks everyone!

Comments are closed.

Packaged by Edublogs - education blogs.