1 00:00:00,570 --> 00:00:02,590 All right, so let's get your Workspace open, 2 00:00:02,590 --> 00:00:06,200 remember Workspaces is your online coding environment, it's web based. 3 00:00:06,200 --> 00:00:10,460 So you can code from anywhere, on any computer with an internet connection. 4 00:00:10,460 --> 00:00:12,890 Now I recommend that you also have a physical keyboard, 5 00:00:12,890 --> 00:00:15,260 coding on a tablet is a bit of a bummer. 6 00:00:15,260 --> 00:00:16,800 I've attached a Workspace for this video. 7 00:00:16,800 --> 00:00:19,150 You should see a button that says launch workspace. 8 00:00:19,150 --> 00:00:19,980 Go ahead and give that a click. 9 00:00:21,430 --> 00:00:23,540 All right, welcome to Workspaces. 10 00:00:23,540 --> 00:00:25,120 This is all yours. 11 00:00:25,120 --> 00:00:29,170 So over here we'll see a list of files underneath this Python Basics here, 12 00:00:29,170 --> 00:00:30,560 it says hello.py. 13 00:00:30,560 --> 00:00:31,400 Now let's go ahead and click that. 14 00:00:33,370 --> 00:00:38,500 So this little area here, this is what is known as a text editor. 15 00:00:38,500 --> 00:00:42,680 And you'll see here we have a tab open, this is a tab. 16 00:00:42,680 --> 00:00:44,560 And this is where we're gonna be writing our code. 17 00:00:45,630 --> 00:00:48,970 Now, as you can see, there is a single line of code here, and 18 00:00:48,970 --> 00:00:51,160 you'll notice that the text is in different colors. 19 00:00:51,160 --> 00:00:54,840 As you can see, there's a reddish color and then there's a teal color here. 20 00:00:54,840 --> 00:00:56,730 This is called syntax highlighting. 21 00:00:56,730 --> 00:00:58,460 Syntax is the rules of the language. 22 00:00:58,460 --> 00:01:02,900 Now, this syntax highlighting is just one way that our editor is gonna help us out. 23 00:01:02,900 --> 00:01:07,020 The traditional first step when learning any programming language is to write this 24 00:01:07,020 --> 00:01:10,780 phrase here, this "Hello, World". 25 00:01:10,780 --> 00:01:12,210 You gotta write that out to the screen. 26 00:01:12,210 --> 00:01:14,470 It's like a rite of passage. 27 00:01:14,470 --> 00:01:16,390 And its history dates way back to the 1960s. 28 00:01:16,390 --> 00:01:18,910 I wanted you to be a part of this tradition. 29 00:01:18,910 --> 00:01:20,810 So there's more information in the teacher's notes. 30 00:01:20,810 --> 00:01:21,600 So here it is. 31 00:01:21,600 --> 00:01:24,220 Here is Hello, World in Python. 32 00:01:24,220 --> 00:01:28,130 What this script is instructing the computer to do is to output, or 33 00:01:28,130 --> 00:01:32,770 print, the string, this string here. 34 00:01:32,770 --> 00:01:38,400 Which is a series of letters and numbers, Hello, World to the screen. 35 00:01:38,400 --> 00:01:41,340 Now, you might have noticed that I'm referring to this file 36 00:01:41,340 --> 00:01:43,960 named hello.py as a script, that's 37 00:01:43,960 --> 00:01:48,450 because we're going to pass this file to what is known as the Python Interpreter. 38 00:01:48,450 --> 00:01:51,230 And the Interpreter is going to read through this file 39 00:01:51,230 --> 00:01:54,020 just like a movie script, line by line. 40 00:01:54,020 --> 00:01:58,810 The Python Interpreter will then interpret meaning from your script and 41 00:01:58,810 --> 00:02:03,170 perform it, or evaluate each line of code. 42 00:02:03,170 --> 00:02:07,140 This bottom area here is known as the console. 43 00:02:07,140 --> 00:02:11,860 Now, this is a terminal session running on your very own version of Linux. 44 00:02:11,860 --> 00:02:15,840 Linux is an operating system much like Windows or Mac OS. 45 00:02:15,840 --> 00:02:19,400 Now, depending on which operating system you're running on your local machine, 46 00:02:19,400 --> 00:02:22,446 you also have an application like this available to you, 47 00:02:22,446 --> 00:02:24,340 it's usually tucked away. 48 00:02:24,340 --> 00:02:28,150 This is what is actually running underneath all of those Windows. 49 00:02:28,150 --> 00:02:31,850 So, on a Windows machine, this console is called the command prompt, or 50 00:02:31,850 --> 00:02:32,890 the PowerShell. 51 00:02:32,890 --> 00:02:34,850 On Mac OS, it's called a terminal. 52 00:02:34,850 --> 00:02:38,970 But this here is running in the Cloud for you, so you don't need to worry 53 00:02:38,970 --> 00:02:42,550 about getting things set up on your local machine just yet. 54 00:02:42,550 --> 00:02:44,310 Check out the teacher's notes if you would like to learn more. 55 00:02:45,380 --> 00:02:48,570 And this here is called the Command Prompt, 56 00:02:48,570 --> 00:02:51,990 this little tilde here means that I'm in my home directory, and 57 00:02:51,990 --> 00:02:57,924 this slash means that I'm in a subfolder or a subdirectory named workspace. 58 00:02:59,010 --> 00:03:02,830 Directories are synonymous with folders in most operating systems. 59 00:03:02,830 --> 00:03:04,850 Now this workspace directory, again, or 60 00:03:04,850 --> 00:03:09,720 folder, is the same one that this file browser here is showing. 61 00:03:09,720 --> 00:03:12,100 You can send commands to your operating system from here. 62 00:03:12,100 --> 00:03:14,360 For instance, if I wanted to list all the files, 63 00:03:14,360 --> 00:03:18,910 I could just run the command ls, which is short for list. 64 00:03:20,190 --> 00:03:23,160 And see how it shows my hello.py file? 65 00:03:23,160 --> 00:03:25,510 It's just like this file browser up here. 66 00:03:25,510 --> 00:03:28,270 It's the same folder, it's the Workspace folder. 67 00:03:28,270 --> 00:03:30,503 So now that we're here at the Command Prompt, 68 00:03:30,503 --> 00:03:33,548 we can actually tell the Python Interpreter to run our script. 69 00:03:33,548 --> 00:03:38,141 Now, you do this by typing Python followed by a space and 70 00:03:38,141 --> 00:03:43,641 then your script's name, which is our script name is hello.py. 71 00:03:43,641 --> 00:03:48,640 Here we go, and now you'll see the output Hello, World indeed. 72 00:03:48,640 --> 00:03:51,680 Wow, that was a whole bunch of new information, right? 73 00:03:51,680 --> 00:03:53,330 Nice job immersing yourself. 74 00:03:53,330 --> 00:03:56,290 We'll talk about all these terms again throughout the course but 75 00:03:56,290 --> 00:03:59,070 let's do one more run through of what just happened. 76 00:03:59,070 --> 00:04:02,520 So we have a file browser over here and it's showing the files from 77 00:04:02,520 --> 00:04:07,260 the Workspace directory, which is the same directory in our terminal session. 78 00:04:07,260 --> 00:04:11,910 And from the command line here we can call the Python Interpreter by typing python 79 00:04:11,910 --> 00:04:17,380 and then we pass our file named hello.py to it. 80 00:04:17,380 --> 00:04:21,920 In our code editor here, we see a single line of code and its syntax highlighted. 81 00:04:21,920 --> 00:04:25,250 That line of code is calling the print function 82 00:04:25,250 --> 00:04:28,790 which is being passed a string Hello, World. 83 00:04:28,790 --> 00:04:33,440 This line, when evaluated, will write out that string to the terminal. 84 00:04:33,440 --> 00:04:35,990 Awesome, glad you got a chance to hang out in Workspaces. 85 00:04:35,990 --> 00:04:37,770 It's a super handy tool. 86 00:04:37,770 --> 00:04:40,870 Remember, you can get the Python Interpreter installed on your computer and 87 00:04:40,870 --> 00:04:43,550 run things there, but let's not focus on that just yet. 88 00:04:43,550 --> 00:04:45,160 Let's get you coding first. 89 00:04:45,160 --> 00:04:46,780 We've only read existing code. 90 00:04:46,780 --> 00:04:48,320 You haven't even written your own yet. 91 00:04:48,320 --> 00:04:49,840 Let's change that. 92 00:04:49,840 --> 00:04:52,880 I know, let me show you a cool feature of the Python Interpreter, 93 00:04:52,880 --> 00:04:56,920 it has an interactive mode where we can type Python and it evaluates immediately. 94 00:04:56,920 --> 00:04:58,390 Let's go do that right after this quick break.