Professional Documents
Culture Documents
Function Assignment1
Function Assignment1
1. Choose ten built-in python functions of your choice and demonstrate their use by providing example
code for each (e.g., print, len(), randint() …). [10 Marks]
2. Using your knowledge of functions, create a program that calculates the area of a circle and outputs
the area when finished. Refer to your notes and online documentation for reference. [10 Marks]
3. The calculation for body mass index (BMI), depends on the units given for weight and height.
Metric calculation: weight is given in kilograms and height in metres and the formula is as
follows:
Imperial calculation: weight is given in pounds and height in inches and the formula is
Instructions
Write a python program to include your own functions in its design. It should still ask the user for their
name, a system of measurement to use (imperial or metric), their height, their weight, and then calculates
their BMI. Output should be a message to the user reiterating their statistics and stating their BMI and
what it means. TIP: You must use functions where appropriate and define them at the top of your
program.
Sample output:
Donald, with a height of 72 inches and a weight of 170 pounds, you
have a BMI of 23. This is considered normal. [20 Marks]
Save as functionsAssignment1.py