2nd Semester Intro to Computer Science

Teacher Curriculum Map · Student Lesson 3.01 · Original slides

Historical TEALS lesson. Review outdated tools and external links before teaching.

Lesson 3.01: Built-In Functions

Learning Objectives

Students will be able to…

Materials/Preparation

Pacing Guide

Duration Description
5 Minutes Do Now
10 Minutes Lesson
35 Minutes Lab
5 Minutes Debrief

Instructor’s Notes

1. Do Now

2. Lesson

Build Your Own Blocks (Snap) vs Functions (Python)

Function Contract

A function definition is like a contract: you tell the programmer what elements the function expects (name and type of arguments) and the function will perform its purpose. It is good practice to use a comment to specify the purpose and contract of a function, including the type of value it returns, if it returns a value.

* Name:
* Purpose:
* Arguments:
* Returns:

Random in Snap

Random in Snap

Back to the Do Now

More on Function Contracts

* Name: `randint`
* Purpose: generate a pseudo-random integer N such that a <= N <= b
* Arguments: 2 values of type integer: a and b
* Returns: integer

3. Lab

4. Debrief/Exit Ticket

Accommodation/Differentiation

If students are moving quickly, find another library to import from (see bonus in the lab) OR allow students to move on to creating their own functions.

Forum discussion

Lesson 3.01: Built-In Functions (TEALS Discourse Account Required)