Login
📚 Python for Introductory Statistics: Lab Workbook
Chapters ▾

Python Arithmetic Operators

NameOperatorExampleResult
Addition + 5+6 11
Subtraction - 5-6 -1
Multiplication * 5*6 30
Division / 5/6 0.83333
Exponentiation ** 5**2 52 =25

To Write Your Third Python Code

7 × 95

  1. Click + Code on a notebook to add a code cell
  2. Type 7*95
  3. Press the play button to execute the code
  4. 665 is the result
Colab screenshot: three completed cells — print("Hello, world!") with its output, 10+10 with output 20, and 7*95 with output 665.

To Save Your Colab Notebook

Watch demo video

  1. Click Untitled.ipynb at the top of the notebook
  2. Delete the title and replace it by typing python1
  3. Press the enter key
  4. The file python1 is now saved in your Google Drive
  5. Click File and then Save
  6. Close your browser
Colab screenshot: the notebook renamed python1 (highlighted next to the Drive icon) with the File menu open and Save (Ctrl+S) highlighted.

To Open Your python1 Notebook

  1. Click this link or go to your Google Drive.
  2. Click python1 from the list on the pop-up window
  3. The notebook will open

OR click File menu then Open Notebook

Colab screenshot: the saved python1 notebook reopened, showing its three cells and their outputs — Hello, World!, 20 and 665.

General Direction: For the lab questions below:

  1. Add a new code-cell on a Colab notebook
  2. Type the code based on the statement of the lab
  3. Execute the code

Lab 1.1.1

Add a code-cell and type print("Hello, Python!") and press the play button.

view answer

print("Hello, Python!")

Lab 1.1.2

Add a code-cell to your Colab notebook and write a Python code that displays the phrase " Welcome to Python Programming Language."

view answer

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.