Lab 1, CSC430, Spring 2022
1 Starting the Google Colab environment
2 Exercises
8.4.0.8

Lab 1, CSC430, Spring 2022

1 Starting the Google Colab environment

Google colab is extremely easy to use, because Google probably already knows everything about you including your hat size, your social security number, and the number of children you’re going to have and what their names will be. This is called "vertical integration", and means that you should encounter relatively few roadblocks.

Simply start up a browser, and go to

https://colab.research.google.com/

Use the dialog to create a new notebook, and call it lab1.ipynb

In the first cell, import the pytest library using

import pytest

... and evaluate that block.

2 Exercises

In the exercises below, any instruction to "develop a function" implies the following steps:

  1. Deciding what kind of data the function will accept (in future labs, you will have to make decisions about how the data will be structured),

  2. Writing the first line of the function including the function name and parameter names,

  3. Adding a docstring that indicates the purpose of the function,

  4. Writing test cases for the function using assert, and finally

  5. Writing the body of the function.

Naming, function application, and tiny tests:

The beginnings of sequences:

Simple functions:

Decisions:

Arithmetic: