[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.00,0:00:05.93,Default,,0000,0000,0000,,Hi there, my name is Nick Parlante, and\Nthis is the class that explores the basic Dialogue: 0,0:00:05.93,0:00:11.26,Default,,0000,0000,0000,,qualities of computers. How they work,\Nwhat they can and cannot do. And it Dialogue: 0,0:00:11.26,0:00:17.10,Default,,0000,0000,0000,,requires no computer background at all.\NIt's just geared for anyone. So before I Dialogue: 0,0:00:17.10,0:00:21.95,Default,,0000,0000,0000,,get started, I'd like to, take a moment\Nto, thank Google for supporting my early Dialogue: 0,0:00:21.95,0:00:26.28,Default,,0000,0000,0000,,research, into this topic, which\Nultimately helped make this class. Also a Dialogue: 0,0:00:26.28,0:00:31.02,Default,,0000,0000,0000,,quick format note, This class is not just\Nmade of videos. For each video section, Dialogue: 0,0:00:31.02,0:00:35.53,Default,,0000,0000,0000,,there's sorta this written document which\NI'm, I'm scrolling through here, that, Dialogue: 0,0:00:35.70,0:00:40.04,Default,,0000,0000,0000,,parallels the explanations and has\Ndiagrams, and code examples, and stuff in Dialogue: 0,0:00:40.04,0:00:44.72,Default,,0000,0000,0000,,it. So, really at any time, you can switch\Nbetween the video and the document if Dialogue: 0,0:00:44.72,0:00:49.90,Default,,0000,0000,0000,,you'd like to reread an explanation or try\None of the examples or something. There's Dialogue: 0,0:00:49.90,0:00:55.76,Default,,0000,0000,0000,,a big difference between watching me do\Nsomething and then trying it yourself. So Dialogue: 0,0:00:55.76,0:00:59.65,Default,,0000,0000,0000,,my advice would be. A lot of times, at the\Nend of a section, we'll have some Dialogue: 0,0:00:59.65,0:01:02.95,Default,,0000,0000,0000,,exercises. And so, at that time, before\Nyou try the exercises, you could decide, Dialogue: 0,0:01:02.95,0:01:06.56,Default,,0000,0000,0000,,well, are you ready to just jump into the\Nexercises, or would you like to go back to Dialogue: 0,0:01:06.56,0:01:10.08,Default,,0000,0000,0000,,the document and try some\Nof the experiments yourself to sort of Dialogue: 0,0:01:10.08,0:01:13.68,Default,,0000,0000,0000,,cement the knowledge? So, you should at\Nleast know that that's available, for each Dialogue: 0,0:01:13.68,0:01:20.66,Default,,0000,0000,0000,,one of these sections. So I will say that\Nthe, the fundamental equation of computers Dialogue: 0,0:01:20.66,0:01:27.16,Default,,0000,0000,0000,,is computer equals powerful plus stupid.\NPowerful in the sense that computers can Dialogue: 0,0:01:27.16,0:01:32.20,Default,,0000,0000,0000,,do just billions of operations. They work\Njust inconceivable fast. But, the Dialogue: 0,0:01:32.20,0:01:37.71,Default,,0000,0000,0000,,operations are stupid in the sense that\Nthe operations that the computer can do Dialogue: 0,0:01:37.71,0:01:43.10,Default,,0000,0000,0000,,are just very simple, they're totally\Nmechanical. They don't have anything that Dialogue: 0,0:01:43.10,0:01:48.44,Default,,0000,0000,0000,,you would describe as human insight about\Nwhat they're working on. So this weird Dialogue: 0,0:01:48.44,0:01:52.42,Default,,0000,0000,0000,,combination of, sort of, great power\Ncombined with sort of a mechanical Dialogue: 0,0:01:52.42,0:01:57.19,Default,,0000,0000,0000,,stupidity. That pattern will come through\Nvery clearly, as we work on these little, Dialogue: 0,0:01:57.36,0:02:01.96,Default,,0000,0000,0000,,code examples, to sort of play around in\Nthe, in the computer world. Now, I'm being Dialogue: 0,0:02:01.96,0:02:06.61,Default,,0000,0000,0000,,a little provocative, sort of making fun\Nof the computer. Oh, they're so stupid, Dialogue: 0,0:02:06.79,0:02:11.50,Default,,0000,0000,0000,,and, but on the other hand, we see that\Ncomputers are, they're very useful. So, in Dialogue: 0,0:02:11.50,0:02:16.21,Default,,0000,0000,0000,,a way, that's what this class is\Nabout. On the one hand visiting this kind Dialogue: 0,0:02:16.21,0:02:21.22,Default,,0000,0000,0000,,of funny computer world that's sort of\Nmechanical, and then connecting it to the Dialogue: 0,0:02:21.22,0:02:26.06,Default,,0000,0000,0000,,way, you know things like email, and MP3\Naudio. Things that in the real world that Dialogue: 0,0:02:26.06,0:02:30.72,Default,,0000,0000,0000,,are very useful. Trying to sort of connect\Nthose two worlds, and show you how the Dialogue: 0,0:02:30.72,0:02:35.42,Default,,0000,0000,0000,,computer works, and how it fits into the\Nworld. My goal is that, coming out of the Dialogue: 0,0:02:35.42,0:02:39.95,Default,,0000,0000,0000,,class, you understand how computers work\Nand how they fit into the world. And Dialogue: 0,0:02:39.95,0:02:44.37,Default,,0000,0000,0000,,in a way, you're not intimidated by the\Ncomputer. You don't think of it as some Dialogue: 0,0:02:44.37,0:02:49.84,Default,,0000,0000,0000,,magic, inconceivable box. Also I have a\Nhidden agenda. There are too few computer Dialogue: 0,0:02:49.84,0:02:54.90,Default,,0000,0000,0000,,science people in the world. There are\Nmany problems that we would like to be Dialogue: 0,0:02:54.90,0:02:59.89,Default,,0000,0000,0000,,solved, but there just aren't enough\Npeople out there to program them all. So Dialogue: 0,0:02:59.89,0:03:05.08,Default,,0000,0000,0000,,my hidden agenda is that by opening your\Neyes to the computer world and how it Dialogue: 0,0:03:05.08,0:03:10.13,Default,,0000,0000,0000,,works for some of you, you may find that\Nyou're interested in pursuing computer Dialogue: 0,0:03:10.13,0:03:14.86,Default,,0000,0000,0000,,science in the future. So, first\Napproximation I'm gonna look at; How does Dialogue: 0,0:03:14.86,0:03:19.48,Default,,0000,0000,0000,,a computer work? So inside the computer is\Nreally driven by code. And we're, we'll Dialogue: 0,0:03:19.48,0:03:24.00,Default,,0000,0000,0000,,get into a lot more detail on this later.\NThis will just be our first look. So here Dialogue: 0,0:03:24.00,0:03:28.50,Default,,0000,0000,0000,,I've made a little picture of a\Ncomputer. And code inside the computer is Dialogue: 0,0:03:28.50,0:03:33.82,Default,,0000,0000,0000,,made of these simple instructions. So one\Ninstruction might be to add two numbers, Dialogue: 0,0:03:33.82,0:03:39.27,Default,,0000,0000,0000,,you know, compute what one plus one is or\Ncheck if two is less than ten. So what the Dialogue: 0,0:03:39.27,0:03:44.08,Default,,0000,0000,0000,,computer does, for this first look, is it\Njust runs down this list of Dialogue: 0,0:03:44.08,0:03:49.01,Default,,0000,0000,0000,,instructions. Each instruction is very\Nsimple and the computer is just running Dialogue: 0,0:03:49.01,0:03:53.64,Default,,0000,0000,0000,,down the list doing them, albeit it's\Ndoing them very quickly. But each Dialogue: 0,0:03:53.64,0:03:58.98,Default,,0000,0000,0000,,instruction has this very mechanical kind\Nof fixed feeling. So, I'm gonna say this, Dialogue: 0,0:03:58.98,0:04:04.19,Default,,0000,0000,0000,,I think this leads to a natural question.\NWhich is, well; If the, if the computer is Dialogue: 0,0:04:04.19,0:04:09.34,Default,,0000,0000,0000,,so mechanical just running through the\Ninstructions, how is it that there are so Dialogue: 0,0:04:09.34,0:04:14.23,Default,,0000,0000,0000,,many useful features in the world? So,\NI've got this diagram for that case. So, Dialogue: 0,0:04:14.23,0:04:18.99,Default,,0000,0000,0000,,on the right hand side I'm going to\Nimagine some useful features. Like, Dialogue: 0,0:04:18.99,0:04:23.95,Default,,0000,0000,0000,,red-eye reduction, or instant messaging. And,\NI'm gonna say for this discussion, you Dialogue: 0,0:04:23.95,0:04:28.94,Default,,0000,0000,0000,,know, your phone, your digital camera,\Nthose are all computers. So on the right Dialogue: 0,0:04:28.94,0:04:33.45,Default,,0000,0000,0000,,hand side, I've got the useful feature,\Nred-eye reduction. And on the left hand Dialogue: 0,0:04:33.45,0:04:37.84,Default,,0000,0000,0000,,side, I've got the computer, which is just\Ngoing through its, you know, simple Dialogue: 0,0:04:37.84,0:04:42.47,Default,,0000,0000,0000,,mechanical instructions. So what\Nconnects these two views? And the answer Dialogue: 0,0:04:42.47,0:04:46.54,Default,,0000,0000,0000,,is that really, that's what computer\Nprogramming is. There's a person, a Dialogue: 0,0:04:46.54,0:04:51.01,Default,,0000,0000,0000,,computer programmer, who at first they\Nhave an idea. Oh, we should have red-eye Dialogue: 0,0:04:51.01,0:04:55.71,Default,,0000,0000,0000,,reduction, that would be really useful.\NAnd so they use their creativity and their Dialogue: 0,0:04:55.71,0:05:00.12,Default,,0000,0000,0000,,imagination to think of what would be\Nsomething useful to have the computer Dialogue: 0,0:05:00.12,0:05:04.59,Default,,0000,0000,0000,,could do. And then what the computer\Nprogrammer does, is really they structure Dialogue: 0,0:05:04.59,0:05:09.23,Default,,0000,0000,0000,,and break down that problem, so that the\Ncomputer can do it. They really instruct, Dialogue: 0,0:05:09.23,0:05:13.76,Default,,0000,0000,0000,,and you know, structure things so\Nthe computer can actually, do this Dialogue: 0,0:05:13.76,0:05:19.29,Default,,0000,0000,0000,,useful thing. That is what computer\Nprogramming is. And in fact, any useful Dialogue: 0,0:05:19.29,0:05:24.26,Default,,0000,0000,0000,,thing that you've done with your digital\Ncamera, or your cell phone, or your Dialogue: 0,0:05:24.26,0:05:29.70,Default,,0000,0000,0000,,computer, really behind the scenes, there\Nwas a person that was making that happen. Dialogue: 0,0:05:29.70,0:05:34.87,Default,,0000,0000,0000,,And I kinda like this combination. In a\Nway, the programmer, the person, Dialogue: 0,0:05:34.87,0:05:40.58,Default,,0000,0000,0000,,brings their creativity and insight about\Nthe world and thinking of stuff that would Dialogue: 0,0:05:40.58,0:05:45.57,Default,,0000,0000,0000,,be useful to have done, and that's\Ntheir half of the problem. And the computer Dialogue: 0,0:05:45.57,0:05:50.22,Default,,0000,0000,0000,,brings what the computer's good at. And I\Nwould say the computer is good at being Dialogue: 0,0:05:50.22,0:05:54.79,Default,,0000,0000,0000,,ultimately pretty inexpensive. And the\Ncomputer is able to do these instructions Dialogue: 0,0:05:54.79,0:05:58.73,Default,,0000,0000,0000,,very, very quickly and so, we get, you\Nknow, ultimately we get this nice Dialogue: 0,0:05:58.73,0:06:03.01,Default,,0000,0000,0000,,combination. And in a way that's why there are so many computers in Dialogue: 0,0:06:03.01,0:06:07.67,Default,,0000,0000,0000,,the world doing so many useful things. It\Nshows this is this is a good partnership Dialogue: 0,0:06:10.02,0:06:12.21,Default,,0000,0000,0000,,between people and computers. In a way\Nthis diagram also is a little bit of a Dialogue: 0,0:06:12.21,0:06:16.76,Default,,0000,0000,0000,,summary of this class. We're going to\Nvisit on the left hand side to see sort of Dialogue: 0,0:06:16.76,0:06:21.27,Default,,0000,0000,0000,,see what the computer world looks like.\NAnd look at the connection between that Dialogue: 0,0:06:21.27,0:06:25.85,Default,,0000,0000,0000,,and actual features that you've used and sort\Nof understand how the computer fits into Dialogue: 0,0:06:25.85,0:06:32.51,Default,,0000,0000,0000,,the world and gets stuff done. So, in the\Nsecond half of this section, I'm gonna Dialogue: 0,0:06:32.51,0:06:37.41,Default,,0000,0000,0000,,start doing little, little coding\Nexamples. And I should mention, this is Dialogue: 0,0:06:37.41,0:06:42.45,Default,,0000,0000,0000,,gonna require a little bit of patience.\NI'm gonna start doing coding. And our Dialogue: 0,0:06:42.45,0:06:47.48,Default,,0000,0000,0000,,first code examples are going be very\Nsimple. They are not going to do anything Dialogue: 0,0:06:47.48,0:06:51.71,Default,,0000,0000,0000,,flashy. I'll say it's a little bit like\NLEGO bricks. Each bit of code that we Dialogue: 0,0:06:51.71,0:06:56.12,Default,,0000,0000,0000,,learn is one more brick, and eventually we\Nare going to be able to put these things Dialogue: 0,0:06:56.12,0:07:00.27,Default,,0000,0000,0000,,together and make stuff that's pretty\Nneat. But these first couple of sections, Dialogue: 0,0:07:00.43,0:07:04.85,Default,,0000,0000,0000,,the things, we got to start somewhere, and\Nthese first examples are very simple. So I Dialogue: 0,0:07:04.85,0:07:09.16,Default,,0000,0000,0000,,ask you to be patient, I promise we will\Nget somewhere neat with this material. Oh, Dialogue: 0,0:07:09.16,0:07:13.31,Default,,0000,0000,0000,,and actually here, I put in a little bit\Nof foreshadowing, so actually within a Dialogue: 0,0:07:13.31,0:07:18.29,Default,,0000,0000,0000,,couple of hours of lecturing. We'll start\Ndoing, visual special effects. And so Dialogue: 0,0:07:18.29,0:07:23.43,Default,,0000,0000,0000,,we'll play around with the famous, shown\Nhere Monkey Moon Banana problem. So that's Dialogue: 0,0:07:23.43,0:07:28.44,Default,,0000,0000,0000,,just a little foreshadowing of where we're\Ngonna get. But for today we're just doing Dialogue: 0,0:07:28.44,0:07:32.78,Default,,0000,0000,0000,,simple bits of coding. So for these code\Nexercises, we're gonna be using a computer Dialogue: 0,0:07:32.78,0:07:36.73,Default,,0000,0000,0000,,language called JavaScript. JavaScript is\Na really popular language. It works in Dialogue: 0,0:07:36.73,0:07:40.88,Default,,0000,0000,0000,,web browsers, so that's why it's\Nextremely popular. And that's why it's an Dialogue: 0,0:07:40.88,0:07:44.60,Default,,0000,0000,0000,,actual fit for this class. Because it,\Nbecause we're working in the web browser, Dialogue: 0,0:07:44.60,0:07:48.54,Default,,0000,0000,0000,,that means our code can work pretty\Neasily. We're gonna use JavaScript plus Dialogue: 0,0:07:48.54,0:07:52.82,Default,,0000,0000,0000,,some extensions that I've added just for\Nthis class. So this is not gonna look Dialogue: 0,0:07:52.82,0:07:57.23,Default,,0000,0000,0000,,exactly like a professional JavaScript.\NWe're gonna work on phrases of code that Dialogue: 0,0:07:57.23,0:08:01.64,Default,,0000,0000,0000,,are ultimately quite short. Just enough to\Nsort of get across the points Dialogue: 0,0:08:01.64,0:08:05.94,Default,,0000,0000,0000,,that I want to make and sort of explore computers. But without bringing in a lot of Dialogue: 0,0:08:05.94,0:08:10.15,Default,,0000,0000,0000,,the baggage that would be required for\Nwriting full, professional programs. All Dialogue: 0,0:08:10.15,0:08:14.50,Default,,0000,0000,0000,,right, so here's my first code example. So\Nthe way code is going to work for us is Dialogue: 0,0:08:14.50,0:08:18.55,Default,,0000,0000,0000,,we've got this, little rectangular area.\NAnd this text inside of here, Dialogue: 0,0:08:18.55,0:08:22.96,Default,,0000,0000,0000,,that's code. And then we'll always have a\Nrun button down here. So when I click the Dialogue: 0,0:08:22.96,0:08:27.60,Default,,0000,0000,0000,,run button. What's gonna happen is, the\Ncomputer goes to the top here and it just Dialogue: 0,0:08:27.60,0:08:31.83,Default,,0000,0000,0000,,runs through these lines. And so it's\Ngonna, as we say, it's gonna execute Dialogue: 0,0:08:31.83,0:08:36.80,Default,,0000,0000,0000,,each line. It's gonna do what it says. So\Nin this case what we're looking at is the Dialogue: 0,0:08:36.80,0:08:41.15,Default,,0000,0000,0000,,print function. So there's just the word\Nprint. And the way the print function Dialogue: 0,0:08:41.15,0:08:45.57,Default,,0000,0000,0000,,works is that it has the word print, and\Nthen there's a left parenthesis. And then Dialogue: 0,0:08:45.57,0:08:49.65,Default,,0000,0000,0000,,there's a series of things. So here, I\Njust have the number 6. And then eventually, Dialogue: 0,0:08:49.65,0:08:53.99,Default,,0000,0000,0000,,the line ends with a right parenthesis and\Na semicolon. And what the print function Dialogue: 0,0:08:53.99,0:08:58.60,Default,,0000,0000,0000,,does is it takes the stuff in between the\Nparentheses, and it prints it out. And so Dialogue: 0,0:08:58.60,0:09:04.13,Default,,0000,0000,0000,,actually if you look over here on the\Nright hand side, this is the output of the Dialogue: 0,0:09:04.34,0:09:09.86,Default,,0000,0000,0000,,when I hit the run button there. So if I\Nwere to change this to say, print(42). And Dialogue: 0,0:09:09.86,0:09:15.34,Default,,0000,0000,0000,,run it. Then we see here's the 42. So\Nthat's from this first print line and when Dialogue: 0,0:09:15.34,0:09:21.15,Default,,0000,0000,0000,,I say print(1,2), that's why we\Nsee the, the one and the two over here. So Dialogue: 0,0:09:21.15,0:09:26.43,Default,,0000,0000,0000,,the way this works. I did say that our\Nfirst examples are very, they're not very Dialogue: 0,0:09:26.43,0:09:32.04,Default,,0000,0000,0000,,flashy. So certainly that's\Ntrue here. So I can try you know, adding a Dialogue: 0,0:09:32.04,0:09:37.46,Default,,0000,0000,0000,,few more things here. So I could say comma\N47. So when I run it, okay, now we see we Dialogue: 0,0:09:37.46,0:09:43.27,Default,,0000,0000,0000,,get the one and the two in the 47. Also,\Njust to show that these lines are just Dialogue: 0,0:09:43.27,0:09:49.24,Default,,0000,0000,0000,,taken one time, I'll copy that one,\Nand then I can paste it in a few times, I Dialogue: 0,0:09:49.24,0:09:54.47,Default,,0000,0000,0000,,have multiple lines. So if I run it, now\Nwe can say, alright, Dialogue: 0,0:09:54.47,0:09:59.69,Default,,0000,0000,0000,,just, you know, we just get a, a\Nrepetition of whatever that output was. So Dialogue: 0,0:09:59.69,0:10:06.59,Default,,0000,0000,0000,,one thing to, to point out about this, is\Nthat the syntax of this code. Is not at Dialogue: 0,0:10:06.59,0:10:11.30,Default,,0000,0000,0000,,all free form, It's the opposite, It's\Nvery structured. It has to be just so for Dialogue: 0,0:10:11.30,0:10:16.30,Default,,0000,0000,0000,,the computer to understand it. And that's\Nactually a reflection of the inner nature Dialogue: 0,0:10:16.30,0:10:20.46,Default,,0000,0000,0000,,of the computer. That it has this\Nmechanical fixed quality and so the Dialogue: 0,0:10:20.46,0:10:25.23,Default,,0000,0000,0000,,language that it can understand is\Nalso gonna be mechanical and fixed. So Dialogue: 0,0:10:25.23,0:10:30.30,Default,,0000,0000,0000,,this is a little strange, right at first,\Nthat you can't just start free form just Dialogue: 0,0:10:30.30,0:10:35.30,Default,,0000,0000,0000,,writing English here and just having, the\Ncomputer follow it. So think of this as Dialogue: 0,0:10:35.30,0:10:39.12,Default,,0000,0000,0000,,your first lesson in the nature of\Ncomputers. Or you could think of it as Dialogue: 0,0:10:39.12,0:10:42.51,Default,,0000,0000,0000,,sort of a when in Rome sort of quality.\NIt's, like, look, I'm asking you to visit Dialogue: 0,0:10:42.51,0:10:46.07,Default,,0000,0000,0000,,the world of the computer. And so we're\Ngonna work a little bit in the language of Dialogue: 0,0:10:46.07,0:10:49.41,Default,,0000,0000,0000,,computers. It's gonna feel a little\Nstrange right at first. But the reality Dialogue: 0,0:10:49.41,0:10:54.41,Default,,0000,0000,0000,,is. This is not actually hard. The syntax\Nis, it may be structure, but it's also Dialogue: 0,0:10:54.41,0:10:59.60,Default,,0000,0000,0000,,pretty simple. And so, I would encourage\Nyou to, don't be put off by the slightly, Dialogue: 0,0:10:59.79,0:11:04.79,Default,,0000,0000,0000,,structured mechanical quality of this\Nlanguage. It will enable us to do Dialogue: 0,0:11:04.79,0:11:10.19,Default,,0000,0000,0000,,some neat stuff. Alright, that's my first\Nexample, let's try a second example here. Dialogue: 0,0:11:10.40,0:11:16.43,Default,,0000,0000,0000,,So my first example I just did numbers. So\Nin computer code there's also a thing Dialogue: 0,0:11:16.43,0:11:21.56,Default,,0000,0000,0000,,called a string. And here's a first\Nexample of a string here. Hi in quotes so Dialogue: 0,0:11:21.56,0:11:26.54,Default,,0000,0000,0000,,a string is just a sequence of letters and\Nin the code it's written between the Dialogue: 0,0:11:26.54,0:11:31.70,Default,,0000,0000,0000,,double quotes. So that's why I have the\N"hi". So print can take in numbers and print Dialogue: 0,0:11:31.70,0:11:36.54,Default,,0000,0000,0000,,them, turns out it can also print strings.\NIt just interprets the string as just a Dialogue: 0,0:11:36.54,0:11:41.39,Default,,0000,0000,0000,,sequence of letters and whatever the\Nstring is it just prints them out over Dialogue: 0,0:11:41.39,0:11:46.44,Default,,0000,0000,0000,,here. So, I could change this, you know,\Nit says "hi". I could change it to say, "good Dialogue: 0,0:11:46.44,0:11:51.28,Default,,0000,0000,0000,,day". So the string can have a space on it.\NSo if I ran that then we'll just, we'll Dialogue: 0,0:11:51.28,0:11:57.72,Default,,0000,0000,0000,,just get the good day over here. So in a\Ncomputer program, strings and numbers are Dialogue: 0,0:11:57.72,0:12:02.22,Default,,0000,0000,0000,,both very, very common. So a string in a\Ncomputer program might be used to hold Dialogue: 0,0:12:02.22,0:12:06.83,Default,,0000,0000,0000,,like a URL that you just typed or, maybe\Nin a word processor each paragraph that Dialogue: 0,0:12:06.83,0:12:11.22,Default,,0000,0000,0000,,you're working on might be stored as a\Nstring. So the string is basically this, Dialogue: 0,0:12:11.22,0:12:15.60,Default,,0000,0000,0000,,sequence of letters. It's a very common\Nsort of data in the computer. Another Dialogue: 0,0:12:15.60,0:12:20.21,Default,,0000,0000,0000,,thing that's shown in this code example is\Nthis first line here. That's called a Dialogue: 0,0:12:20.21,0:12:24.94,Default,,0000,0000,0000,,comment, and in JavaScript comments begin\Nwith two slashes, and the way the comment Dialogue: 0,0:12:24.94,0:12:29.63,Default,,0000,0000,0000,,works is, beginning with the two slashes,\Neverything to the right on that line the Dialogue: 0,0:12:29.63,0:12:34.88,Default,,0000,0000,0000,,computer ignores. And so I could use that\Nto write some remark about, you know, oh, Dialogue: 0,0:12:34.88,0:12:39.75,Default,,0000,0000,0000,,I have two strings here. Some little\Nremark or note to myself or something Dialogue: 0,0:12:39.75,0:12:44.81,Default,,0000,0000,0000,,about the code. And so when I run this,\Nthe computer knows to sort of ignore this Dialogue: 0,0:12:44.81,0:12:49.86,Default,,0000,0000,0000,,part. Oh, that's just commentary. So, in\Nsome of my examples later on, you'll see Dialogue: 0,0:12:49.86,0:12:55.18,Default,,0000,0000,0000,,comments sprinkled around where I'm, I'm\Nmaking some remark about, what's going on. Dialogue: 0,0:12:55.36,0:13:01.74,Default,,0000,0000,0000,,So one example I could do here that's a\Nlittle tricky. Is, I'm gonna put the word Dialogue: 0,0:13:01.74,0:13:09.41,Default,,0000,0000,0000,,print inside of this string and we'll see\Nwhat that prints. So here and now, the Dialogue: 0,0:13:09.41,0:13:14.81,Default,,0000,0000,0000,,second line, I get hello to print. So\Nwhat's happened is, the word print inside Dialogue: 0,0:13:14.81,0:13:20.62,Default,,0000,0000,0000,,of a string is not treated as code to run\Nthe way the word print outside, that is a Dialogue: 0,0:13:20.62,0:13:26.16,Default,,0000,0000,0000,,function that the code is called. So when\Nit's inside of the double quotes like Dialogue: 0,0:13:26.16,0:13:31.89,Default,,0000,0000,0000,,that, it's just data. So that is a, a\Ndistinction inside of the code. Well, Dialogue: 0,0:13:31.89,0:13:37.72,Default,,0000,0000,0000,,alrighty. So, I'm gonna, at the end of\Nthis section, we'll have some exercises Dialogue: 0,0:13:37.72,0:13:43.91,Default,,0000,0000,0000,,where you can write some code as I've done\Nhere. So as I mentioned before, Dialogue: 0,0:13:43.91,0:13:50.10,Default,,0000,0000,0000,,the code works within the system of being\Na very structured limited syntax. And it's Dialogue: 0,0:13:50.10,0:13:54.60,Default,,0000,0000,0000,,actually a very common error, even a, you\Nknow, a professional programmer who Dialogue: 0,0:13:54.60,0:13:59.46,Default,,0000,0000,0000,,writes code all day long. When they're\Ntyping in some code, there will tend to be Dialogue: 0,0:13:59.46,0:14:04.25,Default,,0000,0000,0000,,little syntax errors, sprinkled through\Nthe code. Oh, maybe a right parenthesis Dialogue: 0,0:14:04.25,0:14:09.22,Default,,0000,0000,0000,,is missing or there's a typo in one of the\Nwords. And, those syntax errors are very Dialogue: 0,0:14:09.22,0:14:13.72,Default,,0000,0000,0000,,easy to fix. And so it means that when\Nyou first hit that run button, Dialogue: 0,0:14:13.72,0:14:18.51,Default,,0000,0000,0000,,it is very common that there'll be some\Nlittle typo that has to be fixed. And I Dialogue: 0,0:14:18.51,0:14:22.77,Default,,0000,0000,0000,,want you to understand that. Those little\Nerrors do not reflect some deep Dialogue: 0,0:14:22.77,0:14:27.48,Default,,0000,0000,0000,,misunderstanding on your part or some flaw,\Nthose are just superficial little errors Dialogue: 0,0:14:27.48,0:14:32.08,Default,,0000,0000,0000,,that happen in coding all the time. And\Nprofessional programmers make those all Dialogue: 0,0:14:32.08,0:14:36.62,Default,,0000,0000,0000,,the time, and we just think nothing\Nof fixing those. We, we don't even think Dialogue: 0,0:14:38.89,0:14:41.16,Default,,0000,0000,0000,,about it anymore. And so, I think that, when\Npeople are first introduced to coding, Dialogue: 0,0:14:41.16,0:14:45.65,Default,,0000,0000,0000,,this is something that derails them a\Nlittle bit, that there are these little Dialogue: 0,0:14:45.65,0:14:50.13,Default,,0000,0000,0000,,syntax errors and it kinda, it puts them\Noff their game and they think they're doing something terribly wrong when in fact, everyone Dialogue: 0,0:14:50.13,0:14:54.71,Default,,0000,0000,0000,,makes those errors. It's absolutely no big\Ndeal. So. To help, diffuse that problem a Dialogue: 0,0:14:54.71,0:14:58.13,Default,,0000,0000,0000,,little bit, I just wanna go through a\Nbunch of examples where I've... So, I've Dialogue: 0,0:14:58.13,0:15:01.69,Default,,0000,0000,0000,,set up some examples here, where I just\Nhave typical little syntax errors. And I Dialogue: 0,0:15:01.69,0:15:05.21,Default,,0000,0000,0000,,wanna show you what the error looks like\Nwhen you hit the run button. Right? So Dialogue: 0,0:15:05.21,0:15:08.95,Default,,0000,0000,0000,,what's gonna happen is, when I hit the run\Nbutton, it's not gonna work. I'm gonna get Dialogue: 0,0:15:08.95,0:15:12.46,Default,,0000,0000,0000,,some kinda little error. And so I wanna\Nshow you the process of going from the Dialogue: 0,0:15:12.46,0:15:15.80,Default,,0000,0000,0000,,error and fixing the little syntax\Nproblem, just so you're a little bit accustomed. Like, Dialogue: 0,0:15:15.80,0:15:19.22,Default,,0000,0000,0000,,oh yeah, when you first hit the run\Nbutton, that's a very common thing that's Dialogue: 0,0:15:19.22,0:15:22.55,Default,,0000,0000,0000,,gonna happen. So, let's just go through\Nthese. Alright, so I, I hit the run Dialogue: 0,0:15:22.55,0:15:26.38,Default,,0000,0000,0000,,button. And, you know, instead of running\Nand producing output, I got a little bit Dialogue: 0,0:15:26.38,0:15:30.03,Default,,0000,0000,0000,,of an error over here, a little error\Nmessage. Sometimes the error messages are Dialogue: 0,0:15:30.03,0:15:33.73,Default,,0000,0000,0000,,pretty good, describing what's going on.\NSo, let's read this first one, It says, Dialogue: 0,0:15:33.73,0:15:38.72,Default,,0000,0000,0000,,Error: prlnt is not defined. So,\Nwhat's going on here, is print is a Dialogue: 0,0:15:38.72,0:15:44.14,Default,,0000,0000,0000,,function, But this second one here, line\Ntwo, and the, actually in this case it, Dialogue: 0,0:15:44.14,0:15:49.92,Default,,0000,0000,0000,,well, this won't always work, but a lot of\Ntimes it'll highlight the line that has Dialogue: 0,0:15:49.92,0:15:56.34,Default,,0000,0000,0000,,the problem. The problem is that it's a\Ntypo. It doesn't say P R I N T, it says P R L N T. Dialogue: 0,0:15:56.34,0:16:01.05,Default,,0000,0000,0000,,So if I change that to an i. Ha!\NNow it works. So, this little program just Dialogue: 0,0:16:01.05,0:16:05.10,Default,,0000,0000,0000,,prints A, one and a B, a two and a C and a\Nthree, so it's just a little pointless Dialogue: 0,0:16:05.10,0:16:09.30,Default,,0000,0000,0000,,example I made up. Now of course, I did L,\Nbecause I was trying to think of a what's Dialogue: 0,0:16:09.30,0:16:13.25,Default,,0000,0000,0000,,a letter that looks like an I. You would\Nhave to come look carefully, so I was Dialogue: 0,0:16:13.25,0:16:17.18,Default,,0000,0000,0000,,being a mean professor there. Alright,\Nlet's try another one of these. So I'll Dialogue: 0,0:16:17.18,0:16:21.67,Default,,0000,0000,0000,,hit the run button on this one. It says\Nerror, unterminated string literal, and it Dialogue: 0,0:16:21.67,0:16:26.32,Default,,0000,0000,0000,,highlights the second line. So I'm just\Ngonna look at the second line from left to Dialogue: 0,0:16:26.32,0:16:31.08,Default,,0000,0000,0000,,right. You see the one, and there's the B,\NSo you see, the problem here is that this Dialogue: 0,0:16:31.08,0:16:35.62,Default,,0000,0000,0000,,is a string. Our intention was the string\NB, but the closing quote is missing. You Dialogue: 0,0:16:35.62,0:16:40.71,Default,,0000,0000,0000,,need both quotes. I'll try the third one here. Let's Dialogue: 0,0:16:40.71,0:16:45.14,Default,,0000,0000,0000,,see, error, missing right parenthesis. So\Nagain, it's highlighting the line. So I'm Dialogue: 0,0:16:45.14,0:16:49.45,Default,,0000,0000,0000,,gonna, actually, so in this case, the\Nerror message is actually Dialogue: 0,0:16:49.45,0:16:54.28,Default,,0000,0000,0000,,pretty good. It's just saying, hey, look.\NAs with the quotes, the left parenthesis Dialogue: 0,0:16:54.28,0:16:58.48,Default,,0000,0000,0000,,and the right parenthesis, they need to\Nmatch. Like there must be a right Dialogue: 0,0:16:58.48,0:17:02.95,Default,,0000,0000,0000,,parenthesis there, exactly there for the\Nprint command. So now that one works. Dialogue: 0,0:17:02.95,0:17:12.22,Default,,0000,0000,0000,,Alright, here's the last one. Something\Nwrong, it says error, missing right parenthesis, but I looked and the right parenthesis is there. but it happen to this case Dialogue: 0,0:17:12.22,0:17:16.16,Default,,0000,0000,0000,,the error message is just wrong.\NSometimes, when there's a syntax error, Dialogue: 0,0:17:16.16,0:17:20.79,Default,,0000,0000,0000,,the computer, it just becomes confused and\Nit cannot diagnose for you in the error Dialogue: 0,0:17:20.79,0:17:25.24,Default,,0000,0000,0000,,message, it can basically just say, well,\Nsomething's wrong in line two here. So I Dialogue: 0,0:17:25.24,0:17:29.97,Default,,0000,0000,0000,,recommend just looking carefully from left\Nto right and look here, it looks Dialogue: 0,0:17:29.97,0:17:34.40,Default,,0000,0000,0000,,pretty reasonable. It happens, in this\Ncase what's missing, is the comma. And I Dialogue: 0,0:17:34.40,0:17:38.62,Default,,0000,0000,0000,,think that's an example of maybe the\Ndifference between computers and humans. A Dialogue: 0,0:17:38.62,0:17:42.80,Default,,0000,0000,0000,,human could look at that and see your\Nintent. Like, oh, I see the intention here Dialogue: 0,0:17:42.80,0:17:46.96,Default,,0000,0000,0000,,was to print a one and then a B. But the\Ncomputer with this mechanical quality, Dialogue: 0,0:17:46.96,0:17:51.77,Default,,0000,0000,0000,,it's like. Things have to be just as\Nthey're supposed to and so the comma is Dialogue: 0,0:17:51.77,0:17:57.12,Default,,0000,0000,0000,,not optional there must be a comma there\Nand so we're stuck until we fix it. All Dialogue: 0,0:17:57.12,0:18:02.100,Default,,0000,0000,0000,,right. Now that one works. Okay. So that's\Nour first section of just basic print Dialogue: 0,0:18:02.100,0:18:09.12,Default,,0000,0000,0000,,with, numbers and strings. I've got one\Nexample problem here that I'll try. So this is Dialogue: 0,0:18:09.12,0:18:13.69,Default,,0000,0000,0000,,what the exercises will look like a lot of\Ntimes. Although the later exercises will Dialogue: 0,0:18:13.69,0:18:18.04,Default,,0000,0000,0000,,be more fun, I do promise that. So it\Nsays, change the code below so that when Dialogue: 0,0:18:18.04,0:18:22.55,Default,,0000,0000,0000,,run it produces exactly this output. So it\Nsays one, two, buckle, so this is based on Dialogue: 0,0:18:22.55,0:18:26.44,Default,,0000,0000,0000,,the, one, two, buckle my shoe. So this\Ncode, there, there's a code here that does Dialogue: 0,0:18:26.44,0:18:29.91,Default,,0000,0000,0000,,something, but it's just not, not the\Nright thing so we're supposed to change Dialogue: 0,0:18:29.91,0:18:33.38,Default,,0000,0000,0000,,it. Let's see. For one, so what I'm gonna\Ndo is I'm gonna add a two, and then I Dialogue: 0,0:18:33.38,0:18:36.99,Default,,0000,0000,0000,,gotta remember to put in the comma, and\Nthen I'll change this string to be a Dialogue: 0,0:18:36.99,0:18:40.69,Default,,0000,0000,0000,,buckle. Now I can just run it, just see\Nwhat that does. I'd encourage you to, you Dialogue: 0,0:18:40.69,0:18:44.35,Default,,0000,0000,0000,,know, if you have some idea of the code,\Nor you just wanna try something, you know, Dialogue: 0,0:18:44.35,0:18:48.14,Default,,0000,0000,0000,,you're never gonna break anything by just\Ntyping something in here and hitting the Dialogue: 0,0:18:48.14,0:18:51.89,Default,,0000,0000,0000,,wrong button. So, it's good to have a feeling of experimentation. So, Dialogue: 0,0:18:51.89,0:18:58.72,Default,,0000,0000,0000,,there's the first line. And I'll check the\Nsecond line. So three comma, four comma, Dialogue: 0,0:18:58.72,0:19:07.46,Default,,0000,0000,0000,,knock. Alright, oh, right, now that works.\NSo often times when I do a little examples Dialogue: 0,0:19:07.46,0:19:12.95,Default,,0000,0000,0000,,in a document like this It might be that\Nin the video, I'll do a bunch of Dialogue: 0,0:19:12.95,0:19:16.59,Default,,0000,0000,0000,,examples and then you may wanna go try,\Nyou know, be, you'll be curious about the Dialogue: 0,0:19:16.59,0:19:20.51,Default,,0000,0000,0000,,second one. And so you wanna go visit that\None and try some variant and hit the wrong Dialogue: 0,0:19:20.51,0:19:24.15,Default,,0000,0000,0000,,button yourself, that is absolutely\Nsomething you're, you're free to do. Often Dialogue: 0,0:19:24.15,0:19:27.47,Default,,0000,0000,0000,,times, in the document, I'll have the\Nlittle show solution button. So, that Dialogue: 0,0:19:27.47,0:19:31.06,Default,,0000,0000,0000,,means, that you can go visit it and it's\Nblank, so you could do your experiment. Dialogue: 0,0:19:31.20,0:19:34.75,Default,,0000,0000,0000,,But if then if you're curious what the\Ncode was that I used, then that's also Dialogue: 0,0:19:34.75,0:19:38.20,Default,,0000,0000,0000,,available in the document so you can\Ncompare it to your solution. Or if you Dialogue: 0,0:19:38.20,0:19:41.75,Default,,0000,0000,0000,,wanna copy out of it, or whatever, that's\Nfine. Okay. So, that finishes our first Dialogue: 0,0:19:41.75,0:19:44.94,Default,,0000,0000,0000,,section, so check out those coding\Nexercises.