93 |
94 |
94 Now, let's change the previous command ``print 1+2`` to ``print |
95 Now, let's change the previous command ``print 1+2`` to ``print |
95 10*2``. We use the up arrow again to navigate to the previous command |
96 10*2``. We use the up arrow again to navigate to the previous command |
96 and use the left arrow key to move the cursor on to the + symbol and |
97 and use the left arrow key to move the cursor on to the + symbol and |
97 then use the delete key to remove it and type 0 and * to change the |
98 then use the delete key to remove it and type 0 and * to change the |
98 expression to the required one. We hit enter to see the output of |
99 expression as required. We hit enter to see the output of |
99 ``print``. |
100 ``print``. |
100 |
101 |
101 Now, let's say we want to use the function ``round``. We type ``ro`` |
102 Now, let's say we want to use the function ``round``. We type ``ro`` |
102 at the prompt and hit the tab key. As you can see, the IPython |
103 at the prompt and hit the tab key. As you can see, IPython |
103 completes the command. This feature is called the tab-completion. |
104 completes the command. This feature is called the tab-completion. |
104 |
105 |
105 Now, we remove all the characters and just type ``r`` and then hit |
106 Now, we remove all the characters and just type ``r`` and then hit |
106 tab. IPython does not complete the command since there are many |
107 tab. IPython does not complete the command since there are many |
107 possibilities. It just lists out all the possible completions. |
108 possibilities. It just lists out all the possible completions. |
174 |
175 |
175 Please, pause the video here. Do the exercises and then continue. |
176 Please, pause the video here. Do the exercises and then continue. |
176 |
177 |
177 We get 2.0, 2.5 and 2.48, which are what we expect. |
178 We get 2.0, 2.5 and 2.48, which are what we expect. |
178 |
179 |
179 Let's now see how to correct typing errors that we make when typing at |
180 Let's now see how to correct typing errors that we make while typing at |
180 the terminal. As already shown, if we haven't hit the enter key |
181 the terminal. As already shown, if we haven't hit the enter key |
181 already, we could navigate using the arrow keys and make deletions |
182 already, we could navigate using the arrow keys and make deletions |
182 using delete or backspace key and correct the errors. |
183 using delete or backspace key and correct the errors. |
183 |
184 |
184 Let's now type round(2.484 and hit enter, without closing the |
185 Let's now type round(2.484 and hit enter, without closing the |