0. You can check to see what libraries are installed using `conda list` in the Windows Command Line or Mac Terminal.  A sample partial output:

The set of numbers in parentheses are the version numbers, which you can compare to the required minimum versions for the book:


1. There are two simple ways to run the test script:
* in the Python interpreter (using IDLE or by running `python.exe` (Windows) in the command line or `python3` (Macs) in the Terminal), type `plotly_test` and press enter.
* in the Windows command line, type `python.exe plotly_test.py` and press Enter or in the Mac Terminal, type `python3 plotly_test.py` and press return.


2. See below for analytical : Python solutions.

a. $9^{1/2} = \sqrt{9} = 3$ : `9**(1/2)` = 3

b. $9^0.5 = 9^{1/2} = 3$ : `9**0.5` = 3

c. $5 + \frac{7}{8} = 5 + .875 = 5.875$ : `5 + (7/8)` = 5.875

d. $5 + 7 / 8 = 5 + \frac{7}{8} = 5.875$ : `5 + 7 / 8` = 5.875

e. $(5 + 7) / 8 = 12/8 = 1.5$ : `(5 + 7) / 8` = 1.5

f. $(4 + 5)^{1/2} = 9^{1/2} = 3$ : `(4+5)**(1/2)` = 1.5

g. $9 \div 3^2 = 9 \div 9 = 1$ : `9 / 3**2` = 1

h. $2^{3+1} = 2^4 = 16$ : `2**(3 + 1)` = 16


3. See below for analytical : Python solutions.

a. $2 - 3 = -1$ : `2 - 3` = -1

b. $|2 - 3| = 1$ : `abs(2-3)` = 1

c. $4.5 + 3.2 \times 7.8 - 12.1 = 4.5 + 24.96 - 12.1 = 29.46 - 12.1 = 17.46$ : `4.5 + 3.2 * 7.8 - 12.1` = 17.46

d. $(4.5 + 3.2) \times (7.8 - 12.1) = 7.7 \times -4.3 = -33.11$ : `(4.5 + 3.2) * (7.8 - 12.1)` = -33.11

e. $(4.5 + 3.2) \times |7.8 - 12.1| = 7.7 \times 12.1 = 33.11$ : `4.5 + 3.2 * abs(7.8 - 12.1)` = 33.11


4. See below for analytical : Python solutions.

a. $13 \% 10 = 13 - 1\times10 = 3$ : `13 % 10` = 3

b. $10 \% 13 = 10 - 0\times13 = 10$ : `10 % 13` = 10

c. $7 \% 2 = 7 - 3\times2 = 1$ : `7 % 2` = 1

d. $6 \% 2 = 6 - 3\times2 = 0$ : `6 % 2` = 0


5. To get the help for the `pow()` function:
```
>>> help(pow)
Help on built-in function pow in module builtins:

pow(base, exp, mod=None)
    Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments

    Some types, such as ints, are able to use a more efficient algorithm when
    invoked using the three argument form.
```

    a. `pow(2, 3.14)`
    `8.815240927012887`

    b. `pow(2, .5)`
    `1.4142135623730951`

    c. `pow(7, .75)`
    `4.303517070658851`

    d. `6.022 * pow(10, 23)`
    `6.0219999999999996e+23`


6. `pow(7,3) % 3`
`1` 
There is a remainder of $1$, so it is not.


7. See below:

    a. `>>> round(2/3, ndigits = 3)`
    `0.667`

    b. `round(3.14159, ndigits = 2)`
    `3.14`

    c. `round(5.6**3.2, ndigits = -1)`
    `250.0`

    d. `round(1/3.3, ndigits = 9)`
    `0.303030303`


8. See below:

    3b. `Compute the absolute value of 2 - 3 using the abs() function`

    4a. `Compute the remainder of 13 / 10 using the modulo (%) operator`

    5a. `Compute 2 to the power of 5 using the pow() function`

    6. `Determine if 7**3 is a power of 3 using the modulo function.  If result is 0, it is a power of 3`


9. See below:

    a. Invalid - begins with a numeral.  Instead, try `second_trial`.

    b. Invalid - contains an operator.  Instead, try `length_times_width`.

    c. Invalid - contains a character that is not allowable for variable names.  Instead, try `uparrow_volume`.

    d. Invalid - `def` is a Python reserved keyword.  Instead, try `the_def`.

    e. Valid - underscores can be used in an position.

    f. Valid - variable names do not have to have letters.  In fact, `_` is sometimes used for throwaway values.

    g. Invalid - variable names can not have spaces.  Instead, use underscores, like `fast_component`.


10. Define the masses as follows:
```
m_C = 12.011 # g/mol
m_H = 1.008  # g/mol
m_O = 15.999 # g/mol
m_N = 14.007 # g/mol
```

    a. `m_N + 2 * m_O`
    `46.005`

    b. `2 * m_H  + m_O`
    `18.015`

    c. `6 * m_C + 12 * m_H + 6 * m_O`
    `180.156`

    d. `6 * m_C + 6 * m_H`
    `78.114`

    e. `5 * m_C + m_N + 5 * m_H`
    `79.102`

    f. `2 * m_C + 5 * m_H + m_N + 2 * m_O`
    `75.067`


11. `12 * m_C + 30 * m_H + 6 * m_N + 12 * m_O`
`450.402`


12. `m_glycine = 2 * m_C + 5 * m_H + m_N + 2 * m_O`
`6 * m_glycine`
`450.402`


13. See below:

    a. `print(2.0)`
    `2.0`

    b. `print('2.0')`
    `2.0`

    c. `print(2/2)`
    `1.0`

    d. `print('2/2')`
    `2/2`

    e. `print(test)`
    ```
    NameError: name 'test' is not defined
    Cell In[34], line 1
    ----> 1 print(test)
    ```

    f. `print('test')`
    `test`


14. See below:

    a. `print('There are', 14.7 / (2 * m_H + m_O), 'moles of water in 14.7 g of water.')`
    `There are 0.8159866777685262 moles of water in 14.7 g of water.`
    b. `print('There are', 1.35 * 3785.41, 'mL in a gallon.')`
    `There are 5110.3035 mL in a gallon.`
    c. `print('72.5 degrees Fahrenheit is', (72.5-32) * 5 / 9, 'degrees Celsius.')`
    `72.5 degrees Fahrenheit is 22.5 degrees Celsius.`


15. See below:

    a. ```
    def calcMolesWater(m_water):
        print(m_water / 18.015, 'moles of water')
    ```
    `calcMolesWater(14.7)`
    `0.8159866777685262 moles of water`

    b. ```
    def convertToCelsius(T_F):
        print((T_F - 32) * 5 / 9, 'degrees Celsius')
    ```
    `convertToCelsius(72.5)`
    `22.5 degrees Celsius`

    c. ```
    def diluteConc(M2, V1, V2):
        print(M2, 'M diluted from', V1, 'to', V2, 'is', M2 * V2 / V1, 'M.')
    ```
    `diluteConc(.1, 1, 0.01)`
    `0.1 M diluted from 1 to 0.01 is 0.001 M.`

    d. ```
    def diluteVol(M1, M2, V2):
        print('To dilute', M1, 'M to', M2, 'M, with a final volume of', V2, 'L, you need', M2 * V2 / M1, 'L.')
    ```
    `diluteVol(.1, .001, 1)`
    `To dilute 0.1 M to 0.001 M, with a final volume of 1 L, you need 0.01 L.`


17. ```
def waterDiff(m1, m2):
    moles_diff = abs(m1 - m2) / 18.015
    molecules_diff = round(moles_diff, 3) * 6.022 * 10**23
    print('The difference in number of molecules of water is', molecules_diff)
```
`waterDiff(1, .9)`
`The difference in number of molecules of water is 3.6132e+21`

18. ```def costCoolDet(price_lHe = 40):
    # Compute the heat change required given the heat capacity of the detector is 105 J/K
    Q = 125 / (298 - 6) # J
    # Now determine the mass of helium that must boil to absorb this heat, given a latent heat of 20.5 J/g
    m_He = Q / 20.5 # g
    # Calculate the volume of helium that evaporates, given a density of 125 g/L
    V_He = m_He / 125 + 5
    print(round(V_He,1), 'L of helium evaporates.')
    cost_He = V_He * price_lHe
    print('This costs', round(cost_He), 'dollars.')
```
`costCoolDet()`
`5.0 L of helium evaporates.`
`This costs 200 dollars.`

