CSC108H: CodeLab

What is CodeLab?

CodeLab is a set of online Python exercises delivered and supported by a company called Turing's Craft. They are worth 5% of your course mark, and the first set is due at the beginning of the second week. You must purchase a registration from them; the price is $25 USD.

The set of selected exercises has not been finalized; we will finalize each set a week ahead of time, so the Week 2 CodeLab will be finalized on the first day of classes, and the Week 3 Codelab will be finalized on the day that the Week 2 CodeLab is due.

How do I earn full marks on a CodeLab?

Each set of codelab exercises is worth 0.5% of your course grade, and is marked out of 2. To earn 1 mark out of 2 you must:

To earn 2 marks out of 2, you must get all the exercises correct.

The idea behind CodeLab is to give you a place to practise with feedback and hints that will help you learn. So you are allowed to attempt questions more than once. There is one limitation though: you can attempt each question a maximum of 5 times every 30 minutes. This is just to prevent you from randomly trying every possible answer you can think of -- which wouldn't help you learn anything at all.

Completing CodeLab Questions

You can just type Python code into the box provided to answer each question. When you submit, your code is run many times. Each time, CodeLab provides a different set of initial conditions. For example, if you have been asked to "assign the value of variable y to variable x", then CodeLab might run your code once with "y = 0" and once with "y = 'cat'". If your code is correct, you'll get a success message. If your code is incorrect, CodeLab will show you that initial variable names and values that caused your code to fail, and it will tell you what it expected your code would produce. You can use this information to identify why your code was incorrect.

Some students prefer to solve and test the CodeLab questions in Wing first and to copy their answer into CodeLab once they are convinced that it is correct. This approach has several advantages! First, you are familiar with Wing and the debugging tools it provides. Second, you will have the chance to test code yourself -- and then to see if your testing was sufficient.

Can a CodeLab question be wrong?

Absolutely ... but it's not very likely that a correct solution will fail. We've used CodeLab for several years, so most of the errors have been flagged and fixed. In most cases, one of the CodeLab tests will have broken an assumption that you made about the code, so check the feedback CodeLab provides very carefully. You may want to set up the conditions it specifies in Wing and test your code there. If you still can't see the problem, then post the test case that fails on the discussion board (but not your code!) and ask the other students in the course and the instructor for advice.

How to Start Using CodeLab

The first 10 exercises in CodeLab are free so you can start doing the CodeLab homework before paying. But first you must register to get a username and password and put yourself on your instructor's CodeLab roster:

  1. Go to www.tcgo1.com or www.tcgo2.com
  2. Click "Register for CodeLab"
  3. Choose "I am a student in this course..." and click CONTINUE
  4. Enter the Section Access Code: TORO-6716-QFJY-10 and click CONTINUE
  5. When asked to enter your name, be sure to use your real name (as it appears on your Tcard). And when asked for your email address, use
    • your UToronto email.
    • (Be sure to check the email sent to your UToronto account! TuringsCraft needs to be able to contact you; for example, if you forget your password they can then email you a new one. We will occasionally email important course announcements there, and UofT sends critical information, for example about your fees, to that account.)
    • Follow the instructions until you get to the LOGIN screen.

Purchasing CodeLab Access

To submit answers to the exercises after the first 10 you must purchase CodeLab access. You can purchase with a credit card, send a cheque to Turing's Craft, or use Paypal.
  1. Login to CodeLab.
  2. Click the GET FULL ACCESS button.
  3. Follow the instructions; you can choose to pay by credit card, PayPal, or Canadian Postal Order (although the postal order has a $2 surcharge).
  4. Fill out the sequence of forms, making sure to click "Continue" at the bottom of each form.
  5. Return to the LAB portion of CodeLab and continue.