A list gives the times, in seconds, of the R peaks of an ECG. You will find the gaps between them, the heart rate, and whether the rhythm is regular.
The idea. The heart rate in beats a minute is divided by the average time between two beats. The rhythm is regular if every gap is close to the average.
Your tasks.
gaps. It gives the list of the times between neighbouring peaks.heart_rate. It gives the heart rate, rounded to a whole number.is_regular. It gives True if every gap is within s of the average gap.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…