 Hey, what's going on guys root at no shell.com here today, and we are looking at even more Python This is in fact your eighth tutorial. I'm thinking and man Man eight tutorials. Would you look at that? Anyway, let's get started. I'm gonna open up idle and you should too and today We are gonna try and look at the theory of Python programming now Python is kind of designed to It's really in force and encouraged like white space and in clean programming Simple it should be simple. It should be clear. It's understandable like the naming can The way things are named like printing things obviously print does things inputs to get inputs things like that things things that are named certain ways so they so they make sense and We do that on purpose in Python, especially when you have lots of white space you're eating and it encourages indenting and Making clear code that you can see You can understand when you're reading you can understand things when you're reading it comes across clearly to you and that sort of thing But sometimes it might be tough for the programmer to really understand what's happening If they don't fully understand the background or anything like that So what a programmer could do is leave themselves like little notes Throughout the program throughout the source code of what's going on Now the way they do that is with something called comments And that's kind of what I want to talk about in this tutorial other than the idea of keeping things clean and keeping things orderly and tidy and very neat But with common so they come in two different ways They're they have single line comments and multi line comments So now a comment can appear anywhere on a line But anything that is after the symbol that represents that comment is Considered part of the comment like if we had print, I don't know Doug and we print out dog Anything after that if we had a little hashtag here the hashtag is what represents a single line comment We could just say This is what outputs dog The string dog we should make it a little bit more a little bit more precise So now that that comment is completely disregarded It's completely ignored because the Python interpreter doesn't have to look at it It's just it's just a note for the programmer But if we put that anywhere else like say we put that I don't know before the print command It's not gonna run whatsoever because it's a comment Let me let me try that again. Yeah, see nothing. Nothing happens whatsoever And we can have we can comment out comment tags. We could have as many hashtags as we wanted to And put them at completely arbitrarily different places But the left most comment symbol is what's going to take priority there and This is kind of interesting now. You can play with this a lot because There's another there's another sort of comment here We have multi line comments, which I'm going to show you in a in a new window because I think this is Little good. Let me save this as a file dot Python I'll show you guys what I'm doing. First of all, it's yeah, that's already there But I'll overwrite it. I'm just gonna type in my shebang line for good practice Suppose I don't really have to you but you know the more the merrier I guess I don't even know how that idiom goes in that context, but hey, okay. Let's look at you Let's look at what we got here. Let's print out dog again This is kind of a nice guy so print out dog f5 good that works perfectly fine So if we print out dog this let's get our single comment here this displays Duck and there's no change whatsoever, but if we did one two three single quotes These are multi-line comments anything we type in between These these lines here these single quotation marks is a comment It's a whole common the entire no matter how big you want it to be anything we type in between these symbols is a multi-line comment We just type that and get it out of the way So we could type in raw input we could actually have some code in here that we don't want to run See now. It's not gonna ask us for though that raw input, but let's say We put one right here There you go. We could run that but now I get an error. There's this. Oh, that's that's the indentation my bad Do it again. There's still An error because there's an error in the program error while scanning triple quoted string literal So that comment is still it's sort of just floating around in space So we have we gonna we want to clear that up Well, so we'll put in another ending comment there So there's a comment that has absolutely nothing in it But that could help us in the long run too because if we if we run this It's asking us for raw input But if we had something in here and Let's say we didn't want that code We could just comment it out or Comment pieces of this out and you can make like as many nests of comments as you want And this works the same for single line comments, but it won't be as orderly I suppose Da da da da da da da da da da da da da da da da But the idea is you have the you have the capability and you have Access to being able to give yourself notes and a little bit of a little bit of an understanding of what it is that you're doing case You ever forget like maybe you you have just this program Maybe you have the source code that you've been working on for quite a while And then you sort of leave it alone for a little bit You don't touch it for a week maybe in maybe a month and you come back and now you have all this code Except you don't remember exactly what it does sometimes you can't you can't understand all of it So having these comments and writing and being able to write out what you can do and what you have done Is great and you have these little tips and tricks where you can have like three sets of Multi-line comments and you can get rid of things quickly and on the fly now I've done that plenty of times if we check out some of my programs all I'll open up Python oh caps lock is on that's weird Dream yeah, this one here nothing in here. There's a little bit of GTK Let's open up. Let's see new vocab Anything in here? Yeah, look at this Comments it out code just because I feel like I don't need to test that for a little bit And in case if I ever need to Uncomment that it makes it easy for me to just uncomment the top one But then we have all this crap that's commented So what you should do is have a blank comment immediately after that So that does the exact same thing though, but I think if we put a single line comment here that does what we need And then if we take this one out It understands this bottom one as a multi-line comment But if we had the top one up here It understands that as a single line comment Does that make sense? It's kind of like quickly getting rid quickly toggling code on and off only by removing a single line rather than having to worry about both of them so I'll save that but And see I've been making I've been writing some my own comments here and what I do when I have a code block or a piece of program A piece of the piece of the code that has to be indented or at least has a little bit more logic structure I will actually comment out A little tab or at least a little identifier like a stop sign for me to know okay when This this logic flow ends and I'll be able to talk more about that when we're actually looking at more keywords and more structures and more Loops and conditional statements and that sort of thing But for now I still want you to guys I still want you guys to know this is This is the way people write code in python sometimes it all depends on what you feel like is a good thing to do You can have naming conventions. You can have comments Sputtered all throughout your program And you can even make yourself little stop signs for understanding the white space and the logic flow but hey It all depends on what you want to do and that's a little bit of the fun of programming you have choice you have You have control you have manipulation you are god But uh, but yep, that's all I want to show you guys today. Thank you for watching I hope this gave you a little bit of an idea of what you can do with comments Just to keep things easy just the way you can write python code to make it easy and understandable But I've talked for too long guys. Thank you. Thank you again Uh, it'd be cool if you could give me a like maybe a comment. Leave. Yeah, leave a comment. That'd be nice Leave a comment. That's kind of a joke Subscribe if you want to I'm all ears for that and I'll see you again. Adios