Functions

Bonus: transactions

Teagan's Poet
Teagan's Poet

Bonus lessons are optional.

Let's write a basic transaction processing system (TPS - not that one). A TPS tracks business events, like sales, inventory control... the regular stuff of business operations.

Computed fields

Earlier, on Python with Pets

Here's a goats' scores data set we've been using, with errors removed.

Adela functionates

Hey, Adela! Can you write me a function? Called circle_circumference. You send it the radius of a circle, and it returns its circumference.

Bonus: making webpages

Bonus lessons are optional. If you know HTML or are curious about dynamic webpages, this might interest you.

We had versions of the name tag program that output to the screen, a network printer, or a file. You can also make a webpage from the output. Let's see how.

First, here's a function making the HTML for one name tag.

More functions

Define functions before you use them

Ray
Ray

I tried this, and got the error NameError: name 'rect_area' is not defined.