Summary
I recorded this video to guide students through Section 3 of this week’s Python practical, focusing on functions and how they replace repetitive print statements with reusable code. After a brief walkthrough of the notebook interface, I reminded them of the prior if‑else exercise for hypertension detection and then introduced functions as a way to encapsulate logic. I demonstrated defining a function with def, passing arguments, and calling it, showing both literal strings and variables (including user input). I clarified the difference between positional and keyword arguments, illustrated how to avoid overwriting function names, and explained that functions can return values instead of only printing. Using examples like add and a BMI calculator, I showed how return statements let us assign results to variables, and how default arguments simplify optional parameters. I walked through a medication‑dose function that uses a boolean flag to select pediatric dosing. Finally, I assigned the last task: rewrite the BMI calculation as a function that returns a category string, assign that to patient_BMI, and print it. I concluded by previewing next week’s introduction to Pandas for data analysis.