[Tutor] how to rewrite area.py

Alan Gauld alan.gauld at btinternet.com
Wed Feb 22 01:46:03 CET 2012


On 21/02/12 23:51, William Stewart wrote:

> I need to rewrite area.py program so that it has separate functions for
> the perimeter and area of a square, a rectangle, and a circle (3.14 *
> radius**2).

You will find something similar in my tutorial in the topic Branching.
Look under the heading "Python multi-selection" and there is some code 
you should be able to include as template.

Have a go and come back with questions.

> I am horrible at math and I cannot even figure out what I need to do for
> this

Steven has done the math bit for you, so just plug it into the python 
code you need.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list