Python introduction ( Session-1 )

Akansha Yadav introduces Python basics: setting up Replit or VS Code, using the print function, creating variables with proper naming rules, and writing comments with # or triple quotes. She walks through combining text and variables in print statements and answers questions live.
Chapters
Hello everyone, am I audible to you? You can type yes or no in the chat box. Hello everyone, am I audible to you? If yes, please type in the chat box.
Hello.
Let's wait for a few more minutes and then we'll start. Hello, hello everyone. We'll wait for 2 more minutes and then we'll start. So till then, how are you all? How's everything going on? Yeah, we'll wait for 1 or 2 more minutes and then we'll start. Let's see how many of you are going to just join. Yeah, so I think we should start now. So welcome to the first session. Myself, Akansha Yadav. I will be teaching you about Python programming language. In case you have any question or any query while I'm teaching, you can drop your query in the chat box and I will take that query from the chat box itself. If I am audible to you all, just type yes in the chat box so that I can begin with what I wanted to teach you all. Can you hear me all? Okay, so on my screen you are able to see something called replit.com. So this is a platform on which we will be doing coding. So Replit is one of the website, and we do have an application also. So those who wanted to do coding in mobile phone can download the application, and those who have laptop can use this website for doing coding. So you just have to go on to the Google and search for www.replit.com, and this is how the interface will look like. Then you have to sign up using the ID, Gmail ID or Yahoo mail, whatever you have, you can use that, and you can sign yourself up on this website. In case you wanted to do coding on your mobile phone, you have to search for Replit application for Android or iOS, whichever like from mobile phone you have, you can get that easily on Apple Play Store or normal Play Store. So you can get it. So this is the platform that we will be using. In case you wanted to use Visual Studio Code, then that also you can do, but for that you need to download some extensions. So make sure you have Python downloaded on your system, and apart from Python, there should be a Jupyter Notebook as well if you are using Visual Studio Code. So for beginners who are going to start their journey from Python programming language and just starting like doing the coding, then you can use the Replit website. This is going to be the easiest way to do the code. So I will just quickly sign up on this website and we should— so you just have to choose your levels. For example, selecting beginners. No, I got this. Yeah, so this is how your Replit will look like once you will do sign up. So for writing the code, what you have to do is you have to click on this Create Repl button, and then you have to select the language. Basically, on Replit platform, you can do coding in multiple languages. So right now we are learning Python, so I will select Python from here. Suppose you wanted to do website development or any other language you wanted to code in, so you just have to go and search for that language. Suppose you wanted to do HTML, So you can just select this and this will automatically generate a template for you as well. So right now we are going to learn about Python programming language, so I have to select Python. And then you can write down the title for the file. So this is the first session, so I'm going to name it as a first section and then create. So if you are going to use the Replit for doing the coding, you can share your file with others if you wanted to share, or you want others also to work on the same file. So that is also easy way to do. You just have to click on this Invite button, and then you can write down a username if you know. Just like from— in my case, the username is @TheDataAkanshaYadav9. So in case your friend is having the Reflate ID, then you can enter the username, else you can write the email address as well, and then just press the Invite button. There will be a link generated and will be sent to your friend and they can easily join this particular project. I hope I am clear to you all. If I am, then do type in the chat box so that I can also get to know whether you are able to understand or how everything is going on. Yeah, everything is going fine. Can you please guys type yes or no in the chat section? Am I audible to you all? Okay, so you can easily set up this Replit environment, and if you wanted to do the Visual Studio Code, then you can go on to the Google and search for VS Code, and this is how the Visual Studio Code will look like. You just have to go and download as per your operating system. If you are using macOS, then you have to download according to the macOS. Else, if you are using Windows or Linux, you can download it. After downloading this Visual Studio Code, you have to set up some Extensions. So I will quickly show you what are the extensions that you need if you are going to work on Visual Studio Code. I would prefer beginners to use Replit, and if you are like intermediate or you are already went on to the coding, then you can use Visual Studio as well. So I hope my Visual Studio Code environment is visible to you all. So once you have downloaded successfully your Visual Studio Code, you have to go on to the extension, and then from here you have to download few extensions like Python. So this one you have to download. You can download the Python extension pack. For viewing and managing the Python, like, files and packages, you just have to go on to the extension part and you have to download few extensions related to the Python.
And you can normally You wanted to upload any file, or suppose you wanted to create a folder in particular, you can use this icon. This is for creating a new folder. So that icon, and you can add file. Language, we have extensions not only in programming language, but also when we have any image, or when we are downloading any, you know, file, or when we have PDF. So only come extensions, PDF, JPG, PNG. Same way in Python, if you're going to code, you will use .py. Connect with the name of main.py. So this is the file which will be created automatically, but if you're going to do it So we will be starting from the very basics. So if I ask you to print something or write down something, like suppose I want you to print something in this output environment. So what we have to do is there are some commands used in the Python programming language. Programming. So before we start doing coding in programming, in Python programming, so let me tell you what Python is exactly. So basically Python is a high-level language which says that it's easy to learn and there are only English keywords used to just, you know, type the code. Just like I wanted to display something, let's say I wanted to display this code with Akansha Yadav. I just wanted to display this particular sentence, or what we can say. So for this purpose, what I can do is I can use Am I audible to you now? Hindi, we say this.
Akansha Yadav. Okay, now am I audible? Maybe that is due to the networks and all. So am I audible to you now, guys? Now am I audible to you? Hello? Now can you hear me, guys? What about others? Others, can you hear me? Okay, so now I think it's clear. So let's continue. I will repeat everything that I have told till now on my file. So here what I was trying to tell is we are trying to display something in our output environment. So for doing that, as I said, I wanted to display— it means I wanted to print something. So what I am doing is I am using a syntax which says print empty brackets, and within the brackets you have to write what you wanted to print. So in case if that thing that you wanted to print is a message or a sentence or a word or a character, then you will use quotations. Either it can be a single quote or a double quote. In case the word, the thing that you wanted to print is a number, then quotations are not required. Is this clear to you all? So normally, if you wanted to print any message or any character, suppose I'm printing simply 'a,' then also you need a quotations because that is also a character, English letter. If you wanted to print something else, let's suppose I wanted to print hash, then also I need quotation. That is also a character, whether it is a special character, but still you need a quotation for printing it. In case that is a number then you don't need any quotations. So here I have printed in line number 4, I'm just— I've just written random numbers and I just said print and I just printed the numbers for me. In case you are not going to use the quotation for characters, you will get some errors. So if you can see, name K is not defined. So that's because I wanted to just print the K, but Python environment is taking it as a variable and searching for the K in your Python file. If this print concept is clear to you all, please type yes in the chat box so that I can continue with the next concept. So is this clear to you all, the print concept that we discussed just now? If you guys have any question related to this, you can just type your question in the chat box. I will take it from there. It would be helpful to just respond. You, can you please type yes or no in the chat box? Is everything going good? Shall we continue with the next concept? Okay, so the next concept in the Python programming language is of variable. So now let's discuss what variables are. So basically, variables are like a container. Suppose in real life you wanted to store something, so what you can do is you will need something like a box or a container to store it. Suppose I have chocolates, or I wanted to store water, or pen, or something, anything basically in real life. So what do we need? We need a container. It can be a box, it can be a jar, or any other thing. So same way, if you wanted to store something in your laptop using your programming, and you are going to store something in the memory of your laptop, so what you need is you need a variable to store it. Within that programming language. So variables are nothing but a container to store something. So this is our valid variable, which is first name. Here I am not writing any number in starting. Here I am not using any spaces as well, and I'm storing a message in it, so I'm using, uh, quotations as well. Okay, what about now? Am I audible to you now? Can you hear me, guys? Now can you hear me? Okay, so we were discussing about variables. As I said, variables are just a container to store some things. So in this case, I am writing firstName and I'm assigning for my name to this firstName variable. I'm using equal to to assign anything. So in case I wanted to store a number, I can store it with the name number1 is equal to, let's suppose, 25. So you can write down a variable, use equal to to assign something, and write down whatever you wanted to assign. So syntax goes like this. So first is going to be the variable, then you will be using equal to, then you will be writing what you wanted to store. So in case in mid of your Python file you wanted to write something that is, that is not a part of your code but that is important to you, not for your Python but for you. So suppose I am writing over here, I wanted to write, I am trying to print code With Akansha Yadav. So I'm just writing this message, and this is not for my Python programming to understand anything. This is not a part of my coding, but this is important to me just to remind next time that what I did at that point, at this point of like time in this file. So what you can do is you can do commenting. So you can use commenting. Now, what is commenting? Commenting is just to store something like which is not a part of your coding, which won't affect your output as well. So what you can do is if you are writing something in the single line, you will use hash in the starting of the line. So once I have written hash, just turned into green color. My Python will easily understand that this is not a part of my code, this is just a message. So if you are writing something in the single line, you will use hash. If you are writing something in more than one line, let's suppose in two lines or three lines. Suppose I'm writing, I am trying to learn Python. So I have written this in two lines, line number 8 and line number 9. So first way to do it is like, I want— I don't want my Python to read this. So what I can I can use hash at the start, I just told you. So in case there are more numbers of lines, so it's not going to be time efficient that you will be adding hash in each and every line. So what you can do is you can, instead of writing hash, you will use quotations. So you will use 3 quotations in starting and 3 quotations in the ending. So 1, 2, 3 in starting. There are 6, let me remove few. Yeah, so 1, 2, 3 in starting and again 1, 2, 3 in the last. So if it is more than one line, it means 2 or 3 lines, or maybe 5, 6. So whatever you wanted to store, you can use this commenting. Commenting, like, for single line you will use hashtags. If you are having more number of lines, you will use these 3 quotations in the starting and 3 quotation in the ending. This can be a double quotes as well. So instead of single quote, you can use double quotes as well. So like this, you will write down the 3 double quotes in the starting and 3 times double quote in the end. Is this clear to you all? So is this concept of commenting is clear to you all? Like, uh, we have discussed about print, we have discussed about variables, we have discussed about the commenting in Python. So if you guys have any question related to any three of the concepts, just let me know. Which one? I don't know which one you are saying. Can you please mention? Can you please mention what do you want me to repeat or You want me to explain again? Okay, so if you are like— suppose I wanted to write a line which says Python is a programming language which is a high-level language which is easy to learn. Easy to understand. So now what I want is I want these 3 lines to be in my file so that next time when I'm going to revise, or next time I'm going to share this file or send this file to someone like my— maybe my friend or colleague— so I want this file to have these lines, but I don't want these files to these lines to affect my output. So what you can do is you can use commenting. Commenting is a way to store your notes also in your Python file. These are the part of your code, but the message that you are typing is not a part of your code. This is just for your— just a part of your notes maybe, or a line that you want to, you know, save into your file. So you just have to use the quotations in the starting from where you are starting your message. You will use the quotations, either single quote 3 times, or else you can use double quotes. Single quotes, if you are using, you will write 3 times single quotes in the starting and 3 times single quotes in the ending of the sentence where you are ending. Same way you can use the double quotes as well. Like this, you will write the multi-line, like, use double quotations. So if you are going to run your file now, this is not going to affect your output. This is still there in your file but not affecting your output. In output, you can only see the code, like, for which you have coded exactly. Like, exactly, we have coded for this, for this, and this. But others are the commenting, like, this is my comment, this is comment. So now you got it. This is for just storing the notes in Python file. Okay, so do you have any question? Oh, just like I told you, you can use the print statement to print your message or a number that you have. Same way you can print whatever you have stored in the variables as well. So suppose I'm going to print my first name, so I can say print my— my name is stored in a variable called firstName, so I just have to write print and then firstName. Then if I will run it, I will get my name in the output. So here we are getting the output. So same way, if you wanted to print which you have, like 25, which I have stored in a variable number1, So I can just write print number 1, and if I will run it, I will get 25 here. So here we are getting— so these two are from the variables. So we have stored these two things in a variable. Variable is going to be invalid if you are going to add spaces. Suppose I am writing cost name. In this case, this is going to be invalid because spaces are not allowed in variable. So you have to avoid using spaces. If you wanted to write space or you wanted to, you know, make it visible like, okay, this is two separate words, these are two separate words, so what you can do is you can use underscore for that. Underscore is allowed in variable. So now you can store your name in this. So this is also a valid variable. In case I wanted to print a message along with what I have stored in my variable, both the things together, so for that what you can do is You have to write down your message within the quotation and follow up with the variable name. So print, suppose I am writing, my name is, and after quotation you will write comma and then the variable name. Comma is basically for separating two things. So here is my message, which is my name is, which is a message, which is a direct message which I wanted to print. And this is my variable. To just separate these two things and to make it meaningful for our Python environment, what I— what we have to do is we can use comma. Let me run it. So now I got the output, my name is Akansha Yadav, like this. So same way, whatever you are going to store in the variable, if you wanted to use that value, you can do it like this. Do you guys have any question in this? Akansha Yadav. Can you please mention in the chat section that everything is going fine or not, if you need anything, if If you are not able to understand, also you can type in the chat box. I have created a poll. You can just tap on yes or either on no. Those who have tapped on yes, can you please type your query in the chat section? Okay, so I don't know what we need to do is if you wanted to print a message along with a variable, right? This is your question? Yes. Then kindly help, kindly help re-explain the second concept of printing a stored variable. The second concept of printing the stored variable is in case you want to print a message along with the value which you have stored in a variable. So for that, what you can do is you just have to use the print command and write down your message. Suppose I'm saying my message is— and use a comma for separation. You can use plus also. And you can write down the variable name. So in my case, my variable is first name. So let's use the different variable. We have a number 1 variable also. So this time I'm going to use number 1. So here is my message. Now see what will happen if you are going to use plus and there are numbers and a string. So this might give you an error. So that is why I prefer using comma. So comma is basically for separation. So we have a message over here then write down a comma, then your variable. Simple 3 steps. First is going to be a message, then comma, then variable. If there are more variables, you can continue doing that. Write a message, then again comma, then your variable, then comma, then message, then again you can write down your variable. Then again comma, then message within the quotation. So whenever you are writing the message, you will use quotations and you will follow them. So now if I'm going to run this, I will get my variables in between the message. These were just the random text that I have typed. So you just have to write your message, then use the comma for separation, then your variable name And if you want more, like more times you have a message, or sometimes you have a complete sentence, then you can continue doing the same process. Did you get it, Aruna? Okay, so let's end this today, and in the next session we will be learning more in Python. Till then, I want you to just sign up on this Replit website, or if you wanted to use Visual Studio Code, you can just download it, set up everything using the extensions in the Visual Studio Code. Phone, and those who are beginners just sign up on this website. If you do not have a laptop, then you can go on to the App Store or you can use Google Play Store for downloading the application which is Replit. So I'm typing the website name also in the chat section and the application name also in the chat. Basically both are the same. Now this is going to be a web application. So, all right everyone, we'll meet in the next session of Python programming. Yes, we are stopping here for the Python session today. We will be continuing with the next concept in the next session. If you have any question, you can just let me know.










