Lecture notes for the Introduction to Computer Science I by James Tam Return to the course web page

Example Programs: Functions Part I

Description

Program name

The first example program: function definition and function call

firstExampleFunction.py

A slight variation of the previous program with an explicitly defined main function

firstExampleFunction2.py

Introduces the use of local variables

secondExampleFunction.py

Simple temperature converter: illustrates the use of parameter passing

temperature.py