 Okay, welcome to this short tutorial within the introduction to Python programming course. This tutorial is real quick just to show you how to navigate quickly within JupyterLab. So my assumption is that you have been on the GitHub page for this course, GitHub.com slash web artifacts slash intro to Python. And then when you scroll down, I assume that somehow you figured out how to run the installation most likely with the Anaconda distribution. So you will somehow go to anaconda.com slash distribution and download a version of Anaconda. For example, the latest one here with Python 3.7 for your operating system, Windows, Mac or Linux. And after you install that, what you will do in, for example, in Windows, you will look for Anaconda navigator in your stop menu. It should also exist in the Mac somewhere. And then you will open something that looks a little bit like this. And this is called the Anaconda navigator. And you have several applications that you can open from there. And then you will open the JupyterLab application. And then in your web browser, something should open that looks somewhat similar like this. And then I also assume that you figured out how to download the materials for this course with the green button, clone and download. You click on Downloads as SIP. And then you download the SIP file and unpack it and put it in some folder that you can find here. And then just now I want to quickly give you a run-through of how you can navigate notebooks. So first, let's start simple. Let's start with an empty notebook. You see here, it says Notebook, it's a launcher. In case you don't see this, you can here click on the plus button, then you will get a new launcher, but you only need one of them. So what the launcher does, it shows you what type of documents you can open in JupyterLab or create. And for now, you will, of course, create a notebook with Python 3 in it. So note, I have also Julia installed. You probably won't have it. So you will just have one button here. You will click on this button. And then a new empty Jupyter notebook opens. And now the question is, how can you navigate inside the Jupyter Notebook? Well, for example, you can just, you know, let's, I just click here with my mouse. And so you see that there is no focus inside the code cell. In order to get into the code cell, you can, of course, always click in. And then what you see is the frame in the JupyterLab here and the code cell within the notebook becomes fluid, becomes highlighted. If I click out here on the outside, then it's gray. If I click into the cell, the cell is highlighted. That's how you know that you're in a cell. And then what you do is, you can write Python code. For example, you can write print, hello world. And now I hold my control key and enter and I execute the code cell. We see a one because that's the first code cell that was entered. So now I haven't, I'm, I'm moving my mouse, but I haven't pushed any buttons on the mouse. So where am I right now? I am still on the cell, right? I'm still on the cell that is highlighted with the blue, with the blue line here on the left-hand side. So now if I click, or if I hold control and enter key again, I can execute this line of code several times, okay? So now oftentimes when you're in a Jupyter notebook, especially when you're reading through the chapters that I provide, you want to execute a code cell and jump to the next code cell or create a new code cell. So that's the, the same application actually. So what, what do you do? What you do is you press shift and enter, and shift and enter does two things. First it executes the code cell and second it creates in this case a new code cell that where, where I can now enter stuff. So I can now say one plus two and now I will press shift and enter again and the code cell is executed and now I have a new code cell and I can say whatever. What can we say? 42, just 42. And now when I press control enter again and again, I can execute the code cell without creating a new code cell, okay? That's important. Now, how do you, how do you save a file? Well, the best way is just to hit control and F for save. And what you will see is down here in the middle, it will say, it will say saving completed. So control S and it saves. That's the fastest way. You can of course also push here the, or click the save button here or go somewhere in the file menu. But again, control S for save is a lot faster. So now the thing is this, whenever you open a new notebook, or let's say whenever you open a chapter in the book, what you want to do is you want to reset the notebook. So how do you reset a notebook? So here we see the numbers here on the left hand side that means that these code cells have been executed. So in order to reset everything to zero, so to say, we click on restart kernel and then we say restart kernel and clear all output. And then we confirm that. And then what happens is the Python process in the background is restarted. And of course the contents remain the same, but the code cells are now not executed anymore. And now what I can do is with my, with my mouse, I click into the first cell and now I click, I hold shift and I click enter and I execute the first code cell and I move to the second. I click shift, enter again, execute the second code cell, move to the third, and I do it one more time. And then I end up with a new code cell below it. Okay, so control enter and shift enter are good to know. So now I'm in this new code cell that is empty. And let's say I want to delete it. How do you get rid of the code cell? Well, you have to know where you are. So I'm currently in the code cell. How do I see that? Because the frame of the code cell is highlighted. So how do I get out of it without using my mouse? I just press escape and the highlight goes away. And now I'm still on the cell. I'm still on the fourth code cell, but I'm not inside the cell, I'm outside of it. And now what I can do is I can press the button D for delete twice in a row and then the cell is gone. But you should be careful. There is an undo functionality. Here it says undo. There are several undoes, actually. But whenever you delete a cell, there is a chance that you will lose it forever. So you have undo. Sometimes it works, but because it's in a web browser, you never know. So now I am on the third row. How do I see that? I see it with the blue colors here. And I'm also not in the cell. So without using my mouse, how can I go back into the cell that has the 42 in it? I just press enter. No control, no shift. Just enter, and I'm in the cell. And we see that now the cell is highlighted and the cursor blinks. Now I can delete the 42 and put there, for example, an 87. And let's say I want to go out of the cell without executing it. How do I do that? Of course, escape. Now let's say I want to create a new cell below. How can I do that? Well, whenever you are outside of a cell, that means not in a cell, then you can just press the button B for below. And this will create a new cell below. And now I want to delete it again. I press D twice, and it's gone. And again, I'm not in the cell now. I'm on the third cell. Let's say I want to create a new cell, a new code cell above the 87. How do you do that? I just press A for above, and I have a new code cell. And now these are all code cells. Let me say, let's say I want to change the type of the cell. So you have to know the cells have different kinds of cells. The default type is the code cell, where you can just type a Python. But let's say you want to type English text. How can you do that? You want to create a markdown cell. So now we have an empty code cell. How can I make this a markdown cell? Well, you can use your mouse, and you can choose markdown. And then you see that the brackets go away. And that means now this cell is a text cell. So I can say 87 was a good year. And now how do I get out of it? Well, just control Enter. And now I have text. OK. So let's say I want to get rid of it. How do we do that? Just DD, it's gone. And now let's say I want to create a new cell again above. I create A. And now let's say I want to make this a markdown cell without using the mouse. How do you do that? Well, when you are outside a cell, and you just want to, you are on a cell, and you want to change the type. You just push, in this case, M, M for markdown. And then the cell becomes a markdown cell. And now I can press Enter to go into it and write text. And then say Control Enter to go out. And now I have text. OK. And let's say I am on a cell. And I want to make it a code cell. How do you do that? When you are on a cell, just press Y. I don't know why it's Y, but Y is making this cell into a code cell. And now, of course, if I go in, text is not a valid text. So I better put there something else. Let's say 42 times 7. And let's execute this. OK. One thing that you want to remember, always remember, the number in front of the code cell once it's filled in tells you in which order the code cells have been executed. Whenever you're doing assignment, or doing analysis in your job later with Jupyter Lab, what you want to do is, at the end of the day, you want to click Kernel, Restart Kernel, and run all. And what this will do is it will run all the cells from top to bottom. And sometimes the cells hang. I don't know why this happens sometimes, but when I see that, what I do is I say Restart Kernel and clear all. And now they're all empty. Let's try it one more time, Restart and run all. And now it worked. So again, because it's in a web browser, I think sometimes something bad happens. And now the important thing is all the cells have been executed in order. That's important. Whenever you turn in an assignment, you want to make sure that whatever code you turn in works without error from top to bottom. Because oftentimes it happens that you create a variable. Let's say it's towards the end. Let's say let's just do that. Let's say I'm now in the last cell. Let's create a new one with B. And let's say I set a variable A to 99. And now what happens is I could go, let's say, to the first or to the second cell and replace the one plus two with A. And now, of course, Python knows what is A. So if I execute a cell, Python knows that A is 99. However, A is set below. So if I now go back and say kernel, restart kernel and run all, I will get an error. And if you get such an error, don't turn in the assignment. You know that you provided a notebook that doesn't work. So always make sure at the end of when you work on a Jupyter notebook just to restart and run all, restart means we forget all the state in the program and run all means we run it top to bottom in a linear way. And that is how we make sure that everything works. So now let's say I want to replace. Let's say I want to change this cell into a markdown cell. I hit Escape to get out of the cell. I press M to make it markdown. I press Enter to get back into it. And let's say I want to write a bold text. How do we do that? I can write this text is, and now I want to write something bold. How do you do that? Double star bold, double star dot. And now you execute it. And now the text at the end is bold. Important, if you now just click back in, this is called formatting. And whenever you format text, you have to execute the cell, even though it's not a code cell. It's a markdown cell, but they still can be executed. So I hit Control Enter, and now the text is bold. So what are the options that you have? If you use single asterisks here, single stars, then you will have a text in italics. And then what you could do is you could say this is a list colon newline dash first dash second dash third. And now let's execute the code cell. And now we can get dots. This is a bullet point list with no order. If you want to order this, we'll just write first as a 1 dot, 2 dot, and 3 dot, and execute this. And now you have a ordered list. So if you want to learn all about what are the formatting options that you have, you will go to GitHub. And they have a tutorial, Mastering Markdown. And this is like a 10 to 12 minute read at most. And then you know all the options. So you can mark, you can form a text in any way. You can create lists as we see. You can enter, you can put in images. You can use quotations that look nice. You can also put code examples in there and some other stuff. So I'm not going over this. You can read this on your own. It's not so hard. And also you would find many, many videos on that on YouTube, I guess. And yeah, what else is there? So good practice. When you, let's say, want to read the first chapter in the book, double click on the first chapter. Now the chapter opens. And what I do is take some time now. And now we see that that's the file just after downloading it from GitHub. So the cells have already been executed. So the first thing I always do when I start reading in the chapters, I say restart kernel and clear all, and restart it. And now what you can do is you can put your cursor. You can basically click with your mouse once here. And now what I do when I read a Jupyter Notebook is I hold my Shift key. And by pressing Enter, I jump, as you can see with the blue mark on the left hand side, I jump through the book without using the mouse. And also, I'm not using the arrow keys. I'm only using the return button. And once I hit a code cell, what that means is a Shift Enter will execute the code cell and also jump to the next one. So this way, you can read the book in a very efficient way without using mouse or anything. And yeah, and of course, if you want to go back, just use the arrow key. These are the basics that you should know about Jupyter Lab. And yeah, you can do a lot more things with Jupyter Lab. I suggest you look for some video tutorials or other online tutorials on Jupyter Lab, or you will just try it out. You cannot really mess anything up. So just try it out. And I think I showed you all of the basic stuff. And yeah, I think this concludes this short tutorial on how to use Jupyter Lab.