\section{Exercises}
\begin{footnotesize} 
\subsection*{Targeted exercises} 

\subsubsection*{Exercises for Section \ref{Accessing_items_from_dictionaries_using_keys}} 
\begin{enumerate}\setcounter{enumi}{-1}
	\item  Starting with the dictionary that you made in Exercise 23 of Chapter 3, print the following properties for the given solvent:

	\begin{enumerate}
	\item The boiling point of benzene.
	\item The density of cyclohexane.
	\item The density of toluene.
    \item The IUPAC name of \textit{n}-hexane
	\item The density of a mixture of 75\% acetonitrile and 25\% \textit{n}-hexane (assume ideal behavior).
\end{enumerate}


\item   It can be useful to get a collection of the keys and values of a dictionary. If you have a dictionary, \lstinline{my_dict}, you can get a \lstinline{list} of the keys using \lstinline{list(my_dict.keys())} and a list of the values using \lstinline{list(my_dict.values())}. Using this approach, print out all the keys and values for the dictionary you used in Exercise 0.

\item  You can iterate over dictionary keys, using \lstinline{for key in my_dict:} Using this approach, and the dictionary from exercise 0, develop a pair of nested for loops that will print out the string \lstinline{"the value <property value> is associated with the <property> of <solvent>"}, where \lstinline{<property value>} is the dictionary value of each solvent dictionary, \lstinline{`<property>`} is the key associated with the value, and \lstinline{`<solvent>`} is the solvent under consideration.  The last two will be keys of the dictionary.


\end{enumerate}
\subsubsection*{Exercises for Section \ref{Describing_chemical_structures_using_SMILES}} 
\begin{enumerate}\setcounter{enumi}{2}
	\item  Update the dictionary from Exercise 0 to include the SMILES strings of each solvent.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Drawing_molecules_with_RDKit}} 
\begin{enumerate}\setcounter{enumi}{3}
	\item  Using \lstinline{rdkit}, create an image of the structure of each molecule in the dictionary from Exercise 0. If you use the updated version (Exercise 3), then you can simply access the SMILES from the dictionary.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Using_tuples_to_create_unchangeable_lists}} 
\begin{enumerate}\setcounter{enumi}{4}
	\item  Using two different methods, make a tuple from the list \lstinline{[3, 'frog', 9.73, False, 6.02e23]}

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Specifying_colors_using_the_rgb_standard}} 
\begin{enumerate}\setcounter{enumi}{5}
	\item  Make a dictionary of the rgb color designations for the following colors and assign it to a variable. Use the convention that the maximum for any given channel is 255.

    \begin{enumerate}
	\item Pure red.
	\item Pure blue.
	\item Pure green.
	\item Pure cyan.
	\item Pure purple.
	\item Pure orange.
	\item Black.
	\item 50\% gray.
    \end{enumerate}


\item  Find the rgb color designations for the colors of your current school or a past school. Continue using the convention that the maximum value is 255.


\end{enumerate}
\subsubsection*{Exercises for Section \ref{Decoding_data_from_binary_files}} 
\begin{enumerate}\setcounter{enumi}{7}
	\item  There are no Exercises for this section

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Adding_images_to_Plotly_figures}} 
\begin{enumerate}\setcounter{enumi}{8}
	\item  Find a picture of the logo of your current/past school, lab, or employer and add it to a blank Plotly plot.  If you find a bitmap image file (e.g., .png, .jpg, .jpeg, etc.), you can use \lstinline{source = <path to image>}, though you can also read the online documentation for Plotly to find out how to do so. Additionally, if you wish to hide the axes, you can supply the keyword/value \lstinline{visible=False} in the \lstinline{update_xaxes()} and \lstinline{update_yaxes()} methods.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Adding_annotations_to_Plotly_figures}} 
\begin{enumerate}\setcounter{enumi}{9}
	\item  Starting with the final code from Chapter 2, add an arrow pointing to the highest peak in the spectrum.  The arrow line should have a width of 2 pixels and be red.  The annotation text should also be red and say "\lstinline{Measure here (<wavelenth> nm)}."

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Formatting_text_in_Plotly_using_HTML_tags}} 
\begin{enumerate}\setcounter{enumi}{10}
	\item  On a blank Plotly canvas, produce an annotation that is the properly formatted chemical formula for your five favorite molecules or complexes. This means using subscripts and superscripts. 

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Producing_HTML-formatted_text_quickly_using_codechembook.symbols}} 
\begin{enumerate}\setcounter{enumi}{11}

    \item Using \lstinline{codechembook.symbols.typesettingHTML}, write out the following, using using proper formatting: 
    \begin{enumerate}
        \item p$K_a$
	\item $^2H$
	\item $y = a\cdot x^2 + b\cdot x + c$
    \end{enumerate}

	\item  Repeat Exercise 11 using the functions in \lstinline{codechembook.symbols.typesettingHTML}. If you find formatting the chemical formulas frustrating, don't worry, in the next chapter you will learn a better way to do this.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Generating_sequences_of_numbers_using_range}} 
\begin{enumerate}\setcounter{enumi}{13}
	\item  Create a list (not a generator) of integers from 0 to 10, including 10 using an expression that includes \lstinline{range()}.

	\item  Create a list (not a generator) of atomic numbers for the third row atoms using an expression that includes \lstinline{range()}.

	\item  Create a list (not a generator) of integers from 0 to -9, including -9 using an expression that includes \lstinline{range()}.

	\item  Create a tuple(not a generator)  of integers between 0 and 100, including 100, spaced by 10, using an expression that includes \lstinline{range()}.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Synchronizing_iteration_through_multiple_collections_using_zip}} 
\begin{enumerate}\setcounter{enumi}{17}
	\item  You have the following two lists: one that holds the masses in grams of solvent in your sample (\lstinline{[0.567, 0.523, 0.263, 0.983, 0.634]}),  and one that holds the corresponding solvent name ((\lstinline{['n-Hexane', 'Cyclohexane', 'Acetonitrile', 'Toluene', 'Benzene']}).  Write a single loop that prints out the volume of each solvent you used, including its name.
\end{enumerate}


\subsubsection*{Exercises for Section \ref{Specifying_the_result_of_function_evaluation_using_the_return_keyword}} 
\begin{enumerate}\setcounter{enumi}{17}
	\item  Make a function that computes the length of a list and returns it as an integer. Do not use \lstinline{len()}.

	\item  Make a function that accepts a pair of $x$\&$y$values and computes the slope and $y$-intercept associated with the line that would pass through both points and then and returns the value for the slope and the intercept.

	\item  Modify the function from Exercise 19 to instead return a dictionary with two keys, \lstinline{slope} and \lstinline{intercept}.

	
\end{enumerate}
\subsubsection*{Exercises for Section \ref{Describing_how_to_use_your_functions_in_docstrings}} 
\begin{enumerate}\setcounter{enumi}{21}
	\item  Make docstrings for the functions you created in Exercises 18--20.  Include a description of the function's purpose, the parameters it uses (with type and description), and the return value(s) (with type and description).

	
\end{enumerate}
\subsection*{Comprehensive exercises} 
\begin{enumerate}\setcounter{enumi}{22}
	\item  Starting with the dictionary from Exercise 3 of this chapter, write a code that will draw each chemical structure on a blank Plotly canvas. Arrange them in a grid. If you wish to hide the axes, you can supply the keyword/value \lstinline{visible=False} in the \lstinline{update_xaxes()} and \lstinline{update_yaxes()} methods. In this chapter, we demonstrated how to display a svg image, if you would like use a png instead, you can use the function \lstinline{rdkit.Draw.MolToImage()}, supplying the mol object as the first \textbf{positional argument}.
	
	\item  You decide you want to include the formulas of the molecules in the final figure we created this chapter. Add them, using proper super scripting and subscripting for the formula and its charge. Make the formula text color also match the colors of the molecules they label using the \lstinline{font} parameter of the \lstinline{add_annotation()} method. If you need help, you can refer to the technical chapter on Plotly (Chapter \ref{ch:plotly}).

	
	\item  Change the colors used in the final code of this chapter to ones of your choice. You should change the colors of the initial and final data, as well as the molecules being drawn. Make sure the colors for the molecules match those for the data.

	
	\item  Use the Spyder variable explorer or \lstinline{print()} to inspect the Plotly figure object created by the code in this chapter.  You will find that it is structured like a dictionary.  Find the keys for the following elements:

	\begin{enumerate}
    	\item $x$-data
    	\item $x$-axis title
    	\item The color of the line representing the last data series
        \end{enumerate}
\end{enumerate}
\end{footnotesize} 
