1 00:00:00,330 --> 00:00:05,730 Hello and welcome back to our second class of our introduction to Jupiter. 2 00:00:06,060 --> 00:00:10,890 So basically in today's class, we are going to learn how to work with Jupiter and we are going to write 3 00:00:10,890 --> 00:00:14,550 down some basic lines of code once again before starting this class. 4 00:00:14,550 --> 00:00:19,860 I highly suggest you guys to have some basic knowledge of Python because we are going to write down 5 00:00:19,860 --> 00:00:20,950 our first lines of code. 6 00:00:21,300 --> 00:00:23,490 Of course, I'm going to explain them to you. 7 00:00:23,490 --> 00:00:31,440 But once again, to be able to follow the course and not focus only on Python, you guys should have 8 00:00:31,440 --> 00:00:32,210 some basic knowledge. 9 00:00:32,640 --> 00:00:34,270 So let's jump right into it. 10 00:00:34,350 --> 00:00:40,110 The first thing that I'll ask you to do is open up your Anaconda Navigator and launch your Jupiter notebook 11 00:00:40,120 --> 00:00:42,420 simply by clicking the button right here. 12 00:00:43,690 --> 00:00:45,960 So when it's all done, it's going to be launched. 13 00:00:46,730 --> 00:00:49,640 Next thing that we want to do is pretty simple. 14 00:00:49,650 --> 00:00:52,610 We want to open up a new folder. 15 00:00:52,620 --> 00:00:54,660 So in this case, it's going to be a Python three. 16 00:00:58,260 --> 00:01:04,140 When it's all done, they will simply give a name to our folder, let's call it project in this case. 17 00:01:08,520 --> 00:01:12,590 So the first thing that we are going to talk about right here is pretty simple. 18 00:01:12,840 --> 00:01:20,670 We are going to talk about how we're how works the notebook and what exactly you guys can do with, 19 00:01:20,670 --> 00:01:23,820 well, how exactly you can work with it. 20 00:01:24,150 --> 00:01:29,320 And what is the difference between the chapter in the notebook and any other text editor? 21 00:01:29,340 --> 00:01:32,560 Well, text editor, for example, like by chance. 22 00:01:33,330 --> 00:01:37,550 So let's start basically the first thing that you guys have inside of your notebook. 23 00:01:37,620 --> 00:01:38,670 This would be your main page. 24 00:01:39,270 --> 00:01:42,570 You will have the buttons right here so they'll be able to save your changes. 25 00:01:42,570 --> 00:01:45,110 Pretty simple to simply click on the button right here. 26 00:01:45,120 --> 00:01:47,280 And usually it's going to be automatically saved. 27 00:01:47,280 --> 00:01:49,720 So as you can see, the safe mode is activated. 28 00:01:49,740 --> 00:01:56,430 So it's going to be automatically saved then in your term or any other text editor, you usually don't 29 00:01:56,430 --> 00:01:59,400 have cells inside of your notebook and you have cells. 30 00:01:59,640 --> 00:02:02,100 So there is not only one cell. 31 00:02:02,100 --> 00:02:03,470 You can have more than one cell. 32 00:02:03,480 --> 00:02:08,070 For example, if I want to add a cell, it's going to be by clicking on the little plus sign right here. 33 00:02:08,580 --> 00:02:09,300 So pretty simple. 34 00:02:09,300 --> 00:02:15,660 I can add as many cells as I want and it's pretty cool because it allows me to really organize my code. 35 00:02:15,670 --> 00:02:19,350 So say I want to write down a function right here on a store. 36 00:02:19,350 --> 00:02:20,580 Some variables right here. 37 00:02:20,580 --> 00:02:22,470 I want to write down another function right here. 38 00:02:23,280 --> 00:02:28,500 And which is pretty cool is that I can move my cells from up to them if you guys want to duplicate your 39 00:02:28,500 --> 00:02:28,960 cell. 40 00:02:28,980 --> 00:02:31,580 Well, first of all, if you want to delete, your cell is going to be there. 41 00:02:31,590 --> 00:02:33,330 So simply click on the scissors. 42 00:02:33,660 --> 00:02:39,240 If you guys want to duplicate your cells, it's going to be here so you can select a copy cell and you 43 00:02:39,240 --> 00:02:41,040 can copy your cell. 44 00:02:41,040 --> 00:02:43,080 So let's say, for example, we have a cell right here. 45 00:02:43,560 --> 00:02:46,320 We will write down something simple. 46 00:02:46,320 --> 00:02:47,160 So a simple function. 47 00:02:47,160 --> 00:02:49,020 Let's print pizza, for example. 48 00:02:50,400 --> 00:02:51,060 Here we go. 49 00:02:51,060 --> 00:02:53,040 I have my function, so I run my function. 50 00:02:53,040 --> 00:02:54,060 I have pizza right here. 51 00:02:54,420 --> 00:02:56,370 Let's say I want to copy this cell right there. 52 00:02:56,370 --> 00:02:57,450 And I past myself. 53 00:02:57,540 --> 00:03:03,840 And as you can see, it's it's television and it has been copied and pasted down there. 54 00:03:05,320 --> 00:03:10,120 All right, so pretty simple if I want to move myself, so let's say I have more than one cell. 55 00:03:10,390 --> 00:03:11,470 I have a lot of cells. 56 00:03:11,800 --> 00:03:15,070 I can take this code right here and move it from up to down. 57 00:03:15,970 --> 00:03:17,740 So right now, I have absolutely nothing. 58 00:03:17,740 --> 00:03:20,010 I just have a print function with PDA inside of it. 59 00:03:20,020 --> 00:03:21,850 That doesn't mean nothing. 60 00:03:22,360 --> 00:03:26,970 But let's say, for example, I have variables right here that I want to work with them down there. 61 00:03:26,980 --> 00:03:27,560 I can do it. 62 00:03:27,580 --> 00:03:29,230 I can just have my variables here. 63 00:03:29,230 --> 00:03:31,520 And let's say I want to put them down here. 64 00:03:31,540 --> 00:03:36,850 I have a function where I want to take a function and move it somewhere higher or anything. 65 00:03:37,060 --> 00:03:42,440 I can move my cells how I want, which is pretty cool in this case with Jupiter. 66 00:03:43,420 --> 00:03:43,810 All right. 67 00:03:44,140 --> 00:03:47,100 Next thing to run are apps to run our code. 68 00:03:47,110 --> 00:03:48,410 I mean, it's going to be just there. 69 00:03:48,410 --> 00:03:50,470 You simply click on the run button. 70 00:03:50,470 --> 00:03:55,540 If you want to stop the code that is running, it's going to be on the little interrupt button right 71 00:03:55,540 --> 00:03:55,730 here. 72 00:03:57,100 --> 00:04:01,810 So this is for the basics of well, of Python, but of Jupiter. 73 00:04:01,830 --> 00:04:02,130 Sorry. 74 00:04:02,860 --> 00:04:03,820 So it's pretty simple. 75 00:04:03,820 --> 00:04:05,150 As you can see, it's pretty simple to use. 76 00:04:05,560 --> 00:04:09,880 Next thing that we are going to talk about would be our first python lines of code. 77 00:04:09,890 --> 00:04:11,510 So how exactly can we work with it? 78 00:04:11,740 --> 00:04:17,830 So as you saw some seconds before in this with the Jupiter, you don't you don't have a terminal down 79 00:04:17,830 --> 00:04:20,150 here like you do in, for example, by terms. 80 00:04:20,590 --> 00:04:26,910 So basically, if you write down your code, it's going to be printed right under the cell right there. 81 00:04:27,460 --> 00:04:34,300 So just for the purpose, to understand how Jupiter works and for the purpose of everybody who is in 82 00:04:34,300 --> 00:04:40,120 the course and maybe don't understand Python that much, will write down a very simple line of code. 83 00:04:40,120 --> 00:04:46,050 And I will explain really the basics of Python, which we'll talk about variables, numbers and booleans. 84 00:04:47,440 --> 00:04:48,620 So let's set it up. 85 00:04:48,820 --> 00:04:52,880 The first thing that we'll do is simply create two variables that are strings. 86 00:04:52,900 --> 00:04:59,340 So in this case, let's say we will call it name one and name what? 87 00:04:59,350 --> 00:05:00,490 Name to it, name zero. 88 00:05:01,210 --> 00:05:03,730 And in this case, let's name our name Will. 89 00:05:03,730 --> 00:05:05,830 Our name variable will be pizza. 90 00:05:06,910 --> 00:05:14,050 So for those who never really programmed and are right now writing down their first lines of code, 91 00:05:14,380 --> 00:05:20,230 what I'm doing right now is I'm creating my variables, which is a name and name two, and I'm storing 92 00:05:20,230 --> 00:05:22,090 strings inside of my variable. 93 00:05:22,110 --> 00:05:23,650 So I created two variables. 94 00:05:23,650 --> 00:05:28,180 The first one is called the name and the second variable is called name two. 95 00:05:29,260 --> 00:05:33,790 I have three types of variables, which could be strings or plaintext. 96 00:05:33,790 --> 00:05:35,350 Strings are simply plaintext. 97 00:05:35,740 --> 00:05:39,430 I have numbers which can be one to infinity. 98 00:05:39,430 --> 00:05:46,700 So in this case, let's say we have quantity one and quantity two, those two countries will be numbers. 99 00:05:46,720 --> 00:05:50,710 So in this case, will have number two and number four. 100 00:05:52,030 --> 00:05:55,420 So as you can see here, I have my pizza, I have my pasta. 101 00:05:55,750 --> 00:05:56,980 Those two are strings. 102 00:05:57,490 --> 00:05:59,910 And those variables right here are numbers. 103 00:06:00,040 --> 00:06:04,870 It's possible to transform strings into numbers and numbers into strings, because when you write down 104 00:06:04,870 --> 00:06:09,240 a line of code, you can use both strings and numbers at the same place. 105 00:06:09,280 --> 00:06:14,140 So if you try to run, for example, a sentence that contains numbers and strings, it's not going to 106 00:06:14,140 --> 00:06:14,410 work. 107 00:06:14,710 --> 00:06:19,990 You guys need to transform your strings if you want to use only strings to transform all your numbers 108 00:06:19,990 --> 00:06:20,670 into strings. 109 00:06:22,030 --> 00:06:28,160 So let's write down a very simple line of code and that in this case, this line of code right here. 110 00:06:28,600 --> 00:06:30,430 So what exactly this line of code means? 111 00:06:30,430 --> 00:06:31,310 It's pretty simple. 112 00:06:31,930 --> 00:06:35,110 First of all, I want what exactly do I want? 113 00:06:35,140 --> 00:06:37,750 So when I write down, well, let's start by spring. 114 00:06:38,050 --> 00:06:40,300 So first of all, I have my print function. 115 00:06:40,300 --> 00:06:44,610 I ask, I ask, I give the order to print something. 116 00:06:44,950 --> 00:06:45,340 So what? 117 00:06:45,340 --> 00:06:46,420 I give the order to print. 118 00:06:46,420 --> 00:06:49,060 I give the order to print I want. 119 00:06:49,090 --> 00:06:51,530 So this would be the first part of our function. 120 00:06:51,850 --> 00:06:53,150 This is just plain text. 121 00:06:53,170 --> 00:06:53,970 This is a string. 122 00:06:54,640 --> 00:06:55,720 What I want exactly. 123 00:06:55,730 --> 00:06:57,000 I want quantity one. 124 00:06:57,130 --> 00:07:00,160 So quantity one in this case is the number two. 125 00:07:00,910 --> 00:07:03,270 Why I wrote a story right here. 126 00:07:03,310 --> 00:07:06,360 This is the function that we use to transform numbers into string. 127 00:07:06,380 --> 00:07:10,710 So as I said, we can't have strings and numbers inside of the same sentence. 128 00:07:11,650 --> 00:07:13,180 Then what exactly do I want? 129 00:07:13,570 --> 00:07:15,540 I want quantity one plus name. 130 00:07:15,610 --> 00:07:17,670 This means I want two pizzas. 131 00:07:18,130 --> 00:07:26,110 So we have our quantity one, which is two plus name, which is pizza, plus we have our plaintext or 132 00:07:26,110 --> 00:07:26,740 our string. 133 00:07:27,010 --> 00:07:31,450 And and in this case, we just put it inside of those little parenthesis. 134 00:07:32,110 --> 00:07:38,830 Plus I want quantity and number two in this four in this case it means four plus name two. 135 00:07:38,830 --> 00:07:40,050 In this case it means pasta. 136 00:07:40,110 --> 00:07:46,450 So if we were on our app, logically is going to give us I want two pizzas and four pastas. 137 00:07:46,780 --> 00:07:47,590 So let's try it out. 138 00:07:49,140 --> 00:07:53,380 As you can see right here, we have an airside so what exactly do we have in there? 139 00:07:53,430 --> 00:07:57,910 It's pretty simple because it says quantity one is not defined, pretty simple. 140 00:07:57,930 --> 00:07:59,640 Let's try something else. 141 00:08:00,840 --> 00:08:07,380 So usually the error comes when you guys just don't add the little space bar. 142 00:08:08,770 --> 00:08:11,510 And as you can see here, it works so pretty simple. 143 00:08:11,530 --> 00:08:13,210 The problem was simply right here. 144 00:08:13,450 --> 00:08:17,520 So there were no spaces and this is how the erosion. 145 00:08:18,490 --> 00:08:22,300 So this is a typical error with Jupiter that you guys can have. 146 00:08:22,300 --> 00:08:27,880 Sometimes just a little space button will make it work or not work. 147 00:08:27,890 --> 00:08:29,400 So really, be careful about it. 148 00:08:29,590 --> 00:08:36,310 I'm not going to give you a complete course of how to how to debug all errors, because once again, 149 00:08:36,310 --> 00:08:38,610 this is just a really basic line of code. 150 00:08:39,160 --> 00:08:39,600 Certainly. 151 00:08:39,610 --> 00:08:39,850 Yes. 152 00:08:39,850 --> 00:08:42,270 Understand how exactly works in Jupiter. 153 00:08:42,400 --> 00:08:43,450 So it's pretty simple. 154 00:08:43,480 --> 00:08:47,860 Jupiter is, as I said, a text editor and what a notebook. 155 00:08:48,820 --> 00:08:52,640 And you can use it to write down your lines of code. 156 00:08:52,660 --> 00:08:59,260 And right now, you know exactly how it works, how all what all the buttons right here means and how 157 00:08:59,260 --> 00:09:00,010 everything works. 158 00:09:00,040 --> 00:09:02,920 Don't forget to save your works are pretty simple. 159 00:09:02,920 --> 00:09:03,960 You simply save it. 160 00:09:04,300 --> 00:09:08,930 So the sweet next time that you connect to your chapter, you will be able to see your work. 161 00:09:09,280 --> 00:09:14,050 So in this case, if, for example, we decided to click on X right here, we have our project, which 162 00:09:14,050 --> 00:09:17,980 is right there, we can just run it so we can simply click on our project. 163 00:09:18,490 --> 00:09:21,440 And as you can see, we will have our project right here. 164 00:09:21,940 --> 00:09:25,570 So that's it for this class guys, into our next class.