<commit_before>---
layout: post
title: "Aerobic Heart Rate and Calories Burned"
---
<img src="/Images/Aerobic/headline.png" width="300" height="150" class="inline"/><br>
Running Wild

Let's construct a quick program to calculate your maximum aerobic heart rate, and use it to find out how many calories you could burn if you maintained it over the duration of your next run. (Spoiler: You won't and you also shouldn't, you'll hurt yourself.) We'll also figure out a safe range, and calculate how many calories you can burn under that condition as well.

I sincerely hope you choose to eat pie while surrounded by your friends and family this holiday season, rather than think about hypothetical calories.


## Heart Rates via The 180 Methodology    
*Rules*:    
Begin with a baseline of 180 beats per minute (bpm)    
Subtract your age from the baseline.    
Subtract an additional 10 if you've had a major illness or injury, for each condition.    
Subtract an additional 5 if you've had a minor illness or injury, for each condition    
If you've been training for at least 2 years, add 5.    

## Program Approach    
### Part I - Heart Rate:    

In Part I, we'll build a questionnaire method to populate attributes for an instance of a class object representing an individual's profile, then use the 'Rules' we've outlined above to determine the max aerobic heart rate and a subsequent 'safe' heart rate.

### Part II - Calories:    

In Part II, we'll then construct a second questionnaire to populate an instance of a class object to calculate the sweet total caloric burn you could achieve if you could maintain your peak level of activity.



# PART I - Max Heart Rate    
<img src="/Images/Aerobic/heartbeat3.jpg" class="inline"/><br>    
*Image Source: https://peterdewit.wordpress.com/tag/heartbeat/

We'll begin by defining a method to procedurally call our subset of question methods to gather information about you, our user.

## Questionnaire Structure
Used to organize the user input stage of the program, collects an integer age, boolean responses to illness/injury questions, and an integer number of years of previous aerobic training.

```Python3
def questionnaire():
    age = ask_age()
    maj_ill = ask_maj_ill()<commit_msg>Update 2018-11-1-Aerobic.md<commit_after>---
layout: post
title: "Aerobic Heart Rate and Calories Burned"
---
<img src="/Images/Aerobic/headline.png" width="300" height="150" class="inline"/><br>
Running Wild

Let's construct a quick program to calculate your maximum aerobic heart rate, and use it to find out how many calories you could burn if you maintained it over the duration of your next run. (Spoiler: You **won't** and you also **shouldn't**, you'll **hurt yourself**.) We'll also figure out a safe range, and calculate how many calories you can burn under that condition as well.

I sincerely hope you choose to eat pie while surrounded by your friends and family this holiday season, rather than think about hypothetical calories.


## Heart Rates via The 180 Methodology    
*Rules*:    
* Begin with a baseline of 180 beats per minute (bpm)    
* Subtract your age from the baseline.    
* Subtract an additional 10 if you've had a major illness or injury, for each condition.    
* Subtract an additional 5 if you've had a minor illness or injury, for each condition    
* If you've been training for at least 2 years, add 5.    

## Program Approach    
### Part I - Heart Rate:    

In Part I, we'll build a questionnaire method to populate attributes for an instance of a class object representing an individual's profile, then use the 'Rules' we've outlined above to determine the max aerobic heart rate and a subsequent 'safe' heart rate.

### Part II - Calories:    

In Part II, we'll then construct a second questionnaire to populate an instance of a class object to calculate the sweet total caloric burn you could achieve if you could maintain your peak level of activity.



# PART I - Max Heart Rate    
<img src="/Images/Aerobic/heartbeat3.jpg" class="inline"/><br>    
*Image Source: https://peterdewit.wordpress.com/tag/heartbeat/

We'll begin by defining a method to procedurally call our subset of question methods to gather information about you, our user.

## Questionnaire Structure
Used to organize the user input stage of the program, collects an integer age, boolean responses to illness/injury questions, and an integer number of years of previous aerobic training.

```Python3
def questionnaire():
    age = ask_age()
    maj_ill = ask_maj_ill()
{'fraction_non_alphanumeric': 0.06638729598588443, 'fraction_numerical': 0.009925011027790032, 'mean_word_length': 4.022148394241418, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2821845', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1114, 'n_words': 654}