diff options
author | Prabhu Ramachandran | 2017-11-12 00:15:55 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2017-11-12 00:15:55 +0530 |
commit | c2e5205991e5007b2f54f5169c342818760812b2 (patch) | |
tree | e17e6a328a1e0ba99c0d58b47bdf564a70e88f65 | |
parent | d7e4d9c4f65c439bab83de9a0e1c1f0ab8206834 (diff) | |
download | python-workshops-c2e5205991e5007b2f54f5169c342818760812b2.tar.gz python-workshops-c2e5205991e5007b2f54f5169c342818760812b2.tar.bz2 python-workshops-c2e5205991e5007b2f54f5169c342818760812b2.zip |
Add one more complex exercise.
-rw-r--r-- | advanced_python/names_objects.tex | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/advanced_python/names_objects.tex b/advanced_python/names_objects.tex index f7ef9a6..889741d 100644 --- a/advanced_python/names_objects.tex +++ b/advanced_python/names_objects.tex @@ -333,5 +333,24 @@ f(2) \end{frame} +\begin{frame}[fragile] + \frametitle{Exercise 5} +\begin{lstlisting} +def mul(x): + def g(y): + return y*x + return g + +twice = mul(2.0) +twice(20) +\end{lstlisting} +\vspace*{0.1in} + \begin{itemize} + \item Run step-by-step on \url{pythontutor.com} + \item Predict the output before you see the answer + \end{itemize} + +\end{frame} + \end{document} |