From c2e5205991e5007b2f54f5169c342818760812b2 Mon Sep 17 00:00:00 2001
From: Prabhu Ramachandran
Date: Sun, 12 Nov 2017 00:15:55 +0530
Subject: Add one more complex exercise.

---
 advanced_python/names_objects.tex | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

(limited to 'advanced_python/names_objects.tex')

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}
-- 
cgit 

