53 \item look-up documentation of functions |
52 \item look-up documentation of functions |
54 \item interrupt incomplete or incorrect commands |
53 \item interrupt incomplete or incorrect commands |
55 \end{itemize} |
54 \end{itemize} |
56 \end{frame} |
55 \end{frame} |
57 \begin{frame} |
56 \begin{frame} |
|
57 \frametitle{Question 1} |
|
58 \label{sec-2} |
|
59 |
|
60 Type \texttt{ab} and hit tab to see what happens. Next, just type \texttt{a} and |
|
61 hit tab to see what happens. |
|
62 \end{frame} |
|
63 \begin{frame} |
|
64 \frametitle{Solution 1} |
|
65 \label{sec-3} |
|
66 |
|
67 \texttt{ab} tab completes to \texttt{abs} and \texttt{a<tab>} gives us a list of all the |
|
68 commands starting with a. |
|
69 \end{frame} |
|
70 \begin{frame} |
|
71 \frametitle{Question 2} |
|
72 \label{sec-4} |
|
73 |
|
74 Look-up the documentation of \texttt{round} and see how to use it. |
|
75 \end{frame} |
|
76 \begin{frame} |
|
77 \frametitle{Solution 2} |
|
78 \label{sec-5} |
|
79 |
|
80 \texttt{round?} |
|
81 \end{frame} |
|
82 \begin{frame}[fragile] |
|
83 \frametitle{Question 3} |
|
84 \label{sec-6} |
|
85 |
|
86 Check the output of |
|
87 \lstset{language=Python} |
|
88 \begin{lstlisting} |
|
89 round(2.48) |
|
90 round(2.48, 1) |
|
91 round(2.48, 2) |
|
92 |
|
93 round(2.484) |
|
94 round(2.484, 1) |
|
95 round(2.484, 2) |
|
96 \end{lstlisting} |
|
97 Look-up the documentation of \texttt{round} and see how to use it. |
|
98 \end{frame} |
|
99 \begin{frame} |
|
100 \frametitle{Solution 3} |
|
101 \label{sec-7} |
|
102 |
|
103 We get 2.0, 2.5 and 2.48, which are what we expect. |
|
104 \end{frame} |
|
105 \begin{frame} |
|
106 \frametitle{Question 4} |
|
107 \label{sec-8} |
|
108 |
|
109 Try typing \texttt{round(2.484}, and hit enter. and then cancel the command |
|
110 using Ctrl-C. Then, type the command, \texttt{round(2.484, 2)} and resume |
|
111 the video. |
|
112 \end{frame} |
|
113 \begin{frame}[fragile] |
|
114 \frametitle{Solution 4} |
|
115 \label{sec-9} |
|
116 |
|
117 \lstset{language=Python} |
|
118 \begin{lstlisting} |
|
119 round(2.484 |
|
120 ^C |
|
121 |
|
122 round(2.484, 2) |
|
123 \end{lstlisting} |
|
124 \end{frame} |
|
125 \begin{frame} |
58 \frametitle{Summary} |
126 \frametitle{Summary} |
59 \label{sec-2} |
127 \label{sec-10} |
60 |
128 |
61 \begin{itemize} |
129 \begin{itemize} |
62 \item invoking and quitting the \texttt{ipython} interpreter |
130 \item invoking and quitting the \texttt{ipython} interpreter |
63 \item navigating the history |
131 \item navigating the history |
64 \item using tab-completion to work faster |
132 \item using tab-completion to work faster |