Control Flow & Functions Lab

Basics of Python Programming for Pharmaceutical Sciences (BP101T) · Semester 1 · Unit 2: Control Structures & Functions

Practise conditions, loops, break/continue and functions with BMI and pharmacy workflow examples.

What this unit covers

Use conditions, nested decisions, bounded loops, break/continue, arguments, return values, and small functions to model a sample workflow. Dosage and BMI formulas remain programming practice—not patient-specific recommendations.

Apply it

Trace a bounded loop and write a function with arguments and a return value for a sample BMI practice input.

How this lab works

Calculated in your browser from the values you set.

Data used

Sample data made for teaching. No patient, company or clinical records are used.

Limits

For learning only. Results are not clinical, regulatory or quality decisions.

Go to the BP101T courseAll practice labs