1. Mad Libs is a kid's game based on word substitutions. We can make one out of
any short text, like this first verse of the Alma Mater:
> Alma Mater, Old St. Lawrence,
> We are singing now of thee.
> May thy fair name dwell forever
> In our fondest memory.
First we choose a few words to take out. Let's use these:
> Alma Mater, Old St. Lawrence,
> We are ____ing now of thee.
> May thy ____ name dwell forever
> In our fondest ____.
We then ask someone to give us new words (of the right types, but with no
context) and plug them in to get a silly result:
```
Enter a verb: float
Enter an adjective: fabulous
Enter a noun: noodles
Alma Mater, Old St. Lawrence,
We are floating now of thee.
May thy fabulous name dwell forever
In our fondest noodles.
```
Write a program that behaves like this! Name your program madlib.py. See if
you can get the spacing to come out just right. Your Mad Lib should have 4-6
blanks.
2. Compute the windchill given a temperature and wind speed using the formula
provided by the [National Weather
Service](https://www.weather.gov/media/epz/wxcalc/windChill.pdf). Name this
file `windchill.py`. Print the result rounded to one decimal place, like the
23.7 below. As an example, your program input and output should look like the
following:
```
Enter temperature (F): 32.0
Enter wind velocity (MPH): 10.0
The wind chill for 32.0 degrees with a wind velocity of 10.0 MPH is 23.7
degrees.
```
3. Write a function `num_digits` that takes one input parameter, an integer, and
returns the number of digits in that integer. For example, if we were to call
`num_digits(5132981)` it would return 7 because there are 7 digits in
5132981. Hint: this is similar to the checksum program from the textbook
reading.
4. Write a function named `estimate_population` that takes three input
parameters: the rate of population change as a decimal, an initial
population, and a number of years to estimate. This function should return a
population estimate using the following rule: $$P_{t+1} = P_t + rate * P_t$$.
That is, the population of the next year is equal to the previous year’s
population plus the previous year’s population times the rate. Your function
will need to repeat this calculation multiple times, as specified by the
number of years to estimate. For example, `estimate_population(0.0111,
7.5e9, 3)` should return 7,752,532,482.
5. Write a function named draw_triangle that takes one input parameter and
prints a triangle pattern of asterisks. For example, if the function argument
is 6, then the function produces eleven rows of asterisks where the first row
has one asterisk and the sixth row has six asterisks and the eleventh row has
one asterisk as in the sample output below.
Example output for `draw_triangle(6)`:
```
*
**
***
****
*****
******
*****
****
***
**
*
```
CHALLENGE: Try to use only higher-order functions rather than traditional
loops (not because this is required, but because it's a good mental task).
HINT: You can create a string with three (3) asterisks using
`Array.from({length: 3}).map(() => "*").join("")`. There are other ways to
do this, but you might find this helpful.