''' In this exercise, we work with a function that calculates a person's heart rate training zones based on their age and resting heart rate. The function uses the Karvonen formula to calculate the target heart rate zones for light, moderate, and intense exercise. The formula is: Target_HR = Resting_HR + (Maximum_HR − Resting_HR) × Intensity where: Maximum_HR = 220−age Intensities: light (50%), moderate (70%), intense (85%). Exercise A: Add the correct type hints and create a docstring for the function given. Your type hints should be the same as those given in the solution. For the docstring it is mostly important to see if it contains the same elements; the wording will usually be different per programmer. ''' def calculate_heart_rate_zones(age, resting_hr): max_hr = 220 - age # Intensities for light, moderate, and intense exercises intensities = [0.50, 0.70, 0.85] heart_rate_zones = [] for intensity in intensities: heart_rate_zones.append(resting_hr + (max_hr - resting_hr) * intensity) return heart_rate_zones # Example input parameters age_of_person = 30 # years resting_heart_rate = 60.0 # beats per minute # Call the function with the example inputs heart_rate_zones = calculate_heart_rate_zones(age_of_person, resting_heart_rate) # Print the result print("Heart Rate Zones:", heart_rate_zones) ''' Docstrings are not only useful as a summary when looking directly at source code, but also when using functions when not looking at the source code. We can then access docstrings using Python's `help` function. Exercise B: Call the help function on the function you just created the docstring for and your docstring should be displayed. Note: you can also do this with functions you have not created yourself, e.g., import numpy as np help(np.linspace) ''' help(# Your code here)