From 47668fe43b6d1b4154313473443676f621c96e7f Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Sun, 22 Jan 2017 18:58:22 +0530 Subject: Add slide on `type`. --- basic_python/basics.tex | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'basic_python') diff --git a/basic_python/basics.tex b/basic_python/basics.tex index 4201302..d21f893 100644 --- a/basic_python/basics.tex +++ b/basic_python/basics.tex @@ -159,6 +159,23 @@ TypeError: 'str' object does not \end{lstlisting} \end{frame} +\begin{frame}[fragile] + \frametitle{Finding the type} +\begin{lstlisting} +In []: a = 1.0 +In []: type(a) +Out[]: float +In []: type(1) +Out[]: int + +In []: type(1+1j) +Out[]: complex + +In []: type('hello') +Out[]: str +\end{lstlisting} +\end{frame} + \section{Operators} \begin{frame}[fragile] -- cgit