Lab 1: Variables and Functions¶
Open Lab Notebook in Google Colab
Learning Objectives
Become familiar with line-by-line code execution in Python.
Learn the numerical and boolean data types
int,float, andbool.Use arithmetic operators (
+,-, …) and comparison operators (<,==, …).Use the assignment operator
=to create variables.Write and document functions.
Use
if/elif/elseclauses andand/oroperators to dictate control flow.
Take Your Time
The reading for this lab is longer than usual because there is a lot to cover to get started with a new programming language. If you are new to Python, be patient, work carefully though all of the material, and follow the advice in About This Course > How to Succeed.
AI Settings
Before anything else, follow the instructions at Setting Up Google Colab > Disable Google AI Tools.
AI tools that generate code for you are off limits in this course, see About This Course > Avoid Generative AI.