Login
📚 Python for Introductory Statistics: Lab Workbook
Chapters ▾

1.1. Getting Started

Google Colaboratory Notebook (Colab for short) is a free web-based Google product, similar to Google Docs, that requires no software installation for Python programming. A Colab Notebook is a list of cells created by adding a code or a text cell. When you create your own Colab notebooks, they are stored in your Google Drive account.

To Open a New Colab Notebook

Watch demo video

  1. Click this link.
  2. Sign in with your Google account. If you are already signed in, continue to the next step. You can create a free Google account.
  3. Click New Notebook from the bottom-right of the pop-up window.

Note: It may open a new notebook automatically sometimes.

Note: Google Colab Notebook (Picture Below)

Colab screenshot: a new Untitled.ipynb notebook with one empty code cell; a green arrow points out the round play button at the left edge of the cell.

To Write Your First Python Code

  1. Click the code-cell next to the play button
  2. Type print("Hello, World!")

See picture below

Colab screenshot: the code cell now contains print("Hello, world"), ready to run with the play button.

To Execute(run) Your First Python Code

  1. Click the play button located before print("Hello, World!")
  2. Or click on your first Python code and press Ctrl and Enter on your keyboard. Command and Enter for Mac(Apple) computers.
  3. Hello, world! is displayed on a new line
Colab screenshot: after running the cell, the output line Hello, world! appears directly beneath print("Hello, world!").

To Edit the Code

  1. Click the code-cell with print("Hello, World!)"
  2. Start editing

To Write Your Second Python Code

  1. Click + Code in your notebook
  2. Type 10+10 in the new code cell
  3. Click the play button
  4. The output 20 is displayed on a new line
Colab screenshot: arrows highlight the + Code button in the toolbar and the play button beside a new second cell reading 10+10, whose output 20 is shown below it.

Note: If you prefer not to use Google Colab Notebook, you can install free Python in your computer. See appendix 1 for details.

Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.