diff options
author | Prabhu Ramachandran | 2017-01-22 18:58:22 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2017-01-22 18:58:22 +0530 |
commit | 47668fe43b6d1b4154313473443676f621c96e7f (patch) | |
tree | 8a7427c6407ae6a0952d5e33aa6f1c207c9a98f6 /basic_python | |
parent | 584ea34d518f6792ff52dc4ef492f7cd5bd2facb (diff) | |
download | python-workshops-47668fe43b6d1b4154313473443676f621c96e7f.tar.gz python-workshops-47668fe43b6d1b4154313473443676f621c96e7f.tar.bz2 python-workshops-47668fe43b6d1b4154313473443676f621c96e7f.zip |
Add slide on `type`.
Diffstat (limited to 'basic_python')
-rw-r--r-- | basic_python/basics.tex | 17 |
1 files changed, 17 insertions, 0 deletions
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] |