How to do a lab

Five minutes, with pictures. Everything runs in your browser: nothing to install.

Each lab is a notebook: a page that mixes short instructions with small pieces of Python code that you run, change and finish yourself. It runs inside your web browser, on the course website.

1 · Open the lab

On the lab’s page, click ▶︎ Start this lab in your browser. The first time, wait 10 to 20 seconds while Python loads into your browser.

A JupyterLite window: the file list on the left with three lab notebooks, the Lab 1 notebook on the right with its first text cells and a code cell

The lab as it opens: the list of files on the left, the notebook on the right.
  • Left: your files. Right: the notebook.
  • The notebook is made of cells: text cells (instructions) and code cells (grey boxes).
  • Use a computer, with Chrome, Edge or Firefox. A phone is too small.

2 · Run the cells, from the top

Click a code cell, then press Shift + Enter. The cell runs and the next one is selected. (Or click ▶ in the toolbar.)

  • [ ] not run yet · [*] running · [5] done.
  • Always run the cells in order, from the top. Later cells use what earlier cells made.
  • Near the top, the Your numbers cell prints your numbers. They are made from your NetID, and the grader uses the same ones.

The Your numbers cell has run and printed a student's own parameters for the lab and for problems P1 to P3

After running the first cells: your numbers are printed under the cell.

3 · Your turn: finish the code

Where it says Do:, there is a code cell with a line # YOUR CODE HERE. Replace that line with your code.

A code cell outlined in orange: the simulate function with its docstring, a few prepared lines, and a comment YOUR CODE HERE before return None

A “Do” cell: the function is started for you; you write the part marked YOUR CODE HERE.
  • Keep the function’s name and inputs. The grader calls it by that name.
  • The text in triple quotes (the docstring) says exactly what the function must return.

4 · Check your work

The cell right after each function checks it. Run it.

  • public checks passed means you are on track. The grader runs more tests, on data you have not seen.
  • A red box means not yet. Read the last line: it says what is wrong.

A check cell that has run and shows a red error box ending in AssertionError: complete simulate() first

A check that fails: the last line, “complete simulate() first”, says what to do.

5 · Answer the questions

Multiple-choice questions ask you to choose A, B, C or D. Type your letter into the ANSWERS cell near the end, for example "Q2": "B". The numbers you computed go in there automatically.

6 · Problems by hand

Part C has three problems to solve on paper, with your own numbers.

  1. Write out each derivation and its final number.
  2. Take a photo or make a PDF. Name it so it starts with derivation, for example derivation-hw1.pdf.
  3. Click upload (the arrow above the file list) and choose the file, or drag it into the file list.
  4. Type each final number into ANSWERS.

The file browser toolbar with the upload button, an arrow pointing up, outlined in orange

The upload button, above the file list.

7 · Save and submit

  1. Save: Ctrl + S (on a Mac, Cmd + S).
  2. Run the last cell. It sends your answers, the notebook and your derivation file, and prints a receipt like this:
Submitted Homework 1 as jd1234 at 2027-02-05T21:14:03+00:00 (2 files: lab01-phantom-jams.ipynb, derivation-hw1.pdf).
  • You may submit as often as you like before the deadline. The last submission counts.
  • Labs 1 and 2 are open to everyone. To submit, enrolled students log in once at trgy7353.pages.dev/login, in the same browser.

8 · Where your work is kept

Your work is saved in this browser, on this computer. The site does not keep a copy until you submit.

  • Come back on the same computer and the same browser, and your work is still there.
  • Moving to another computer: File → Download, then upload the file there.
  • Do not work in a private or incognito window: everything is lost when it closes.
  • Clearing your browser’s data deletes your work. Download a copy first.

The File menu open, listing Save Notebook, Rename Notebook, Download and other items

The File menu, with Download near the bottom.

When something goes wrong

What you see What to do
NameError: name 'np' is not defined (or another name) You skipped cells. Run → Run All Above Selected Cell, then try again.
A cell stays at [*] Kernel → Restart Kernel, then Run → Run All Above Selected Cell.
complete ... first Finish the function in the cell above.
Submit says you are not logged in Open trgy7353.pages.dev/login in this browser, log in with your NYU email, run the last cell again.
Submit says the file is too large Your photos are too big: the limit is 20 MB. Make a smaller PDF.
My derivation was not sent Its name must start with derivation, and it must be in the same folder as the notebook.
The page stays blank Reload the page. Use Chrome, Edge or Firefox on a computer.
My work is gone It lives in the browser you used. Open the lab in that same browser on the same computer.

Still stuck? Email the instructor with the lab number and a screenshot.