Complete Python Basics: Learn Python from Scratch - Live Tutorial

Akansha Yadav teaches Python fundamentals for beginners, covering why Python matters for data science and AI, how to set up editors like VS Code and PyCharm, and core concepts like variables, data types, indentation, and print statements. She walks through common errors like ValueError and NameError, then builds a simple calculator to tie it together.
Chapters
Hello everyone, am I audible to you all? Hello everyone, am I audible to you all? Hi Faz, hi, hello, hello Abhi, hello Shekhar. Hello, Prashant. Okay, so shall we get started? So I hope you all have downloaded Visual Studio Code or Anaconda or PyCharm on your system. Yes, have you guys downloaded any of these platforms like PyCharm, Visual Studio Code, Anaconda for doing coding in Python? So basically, in today's session, we will be discussing all about Python, what Python is, and Python basic concepts that is required for any job role, whether it is data analyst, machine learning, artificial intelligence, or you want to go for the developer also, then also this live is useful for you. Okay, that's great. So I'm just going to share my screen and we'll get started. So you want me to start from very basics, from what exactly Python is, or you wanted to start your coding journey like directly? You wanted to switch on to the coding platform, or you wanted to know about the basics of Python or anything similar to this? Yeah guys, quickly drop your comments so that we can begin accordingly. Okay, so let's first understand what exactly Python is. So we all know that Python is used everywhere in this 2024, and in 2025 also Python will be on trending only because Python is a high-level language and this is general-purpose language. When I say general-purpose language and high-level language, then there is a big meaning of these two words. First, let's talk about general purpose. General purpose means which can be used anywhere, like however you wanted to use it. And high level means there are two types of languages. One is low-level language, another one is high-level. High-level language means user-friendly language. We all are users We are going to use it for maybe for data analysis project or machine learning project or data science project, or for a— for developing anything, maybe mobile application or websites, anything it could be. So it is user-friendly language. It means users can easily type in their own language, like in English keywords. You can generally, like how we speak, same way we can type the Python code as well. So this is a high-level language feature. We can do so many tasks, like we can create desktop application, we can create database application, we can do network programming, we can do game programming, we can also develop mobile applications, and we can also develop websites. So there are so many things we can do. Why Python is in trend is because it is easy to code. Everywhere, like you are hearing, like on YouTube, on social media, or in the datasets that we are having these days, everywhere it says that Python is on trend because this is developer-friendly language. You can develop anything literally using Python because everything in Python is written in English keywords. There are so many libraries in Python. I will show you a list of libraries which you can use if you wanted to create mobile develop— like mobile app development. You wanted to go for— if you wanted to aim for developer also, then also you need to learn only those specific libraries. You need not to learn everything. There is a misconception while you know, beginners start learning the programming. The first thing is that this— try to learn everything. So you need not to learn everything. You have to be specific. You have to aim for the goal. You have to aim for the role that you are, you know, going to take in future. So accordingly, you have to choose your library and then you have to continue your learning. So anyone can create and contribute to this development because everything which is open source is free to use, free to download. So same way in Python also, there are n number of open source libraries which you can use. It's suppose GUI, it means anything related to the graphical user interface also you can create. Just like in these sessions which I have taken, like the batches and all, I introduced you to one of the library using which you can create your portfolio. Portfolio means it's going to be GUI, you can add your buttons to download your resume. Anything similar to this you can do because it supports GUI. It means it supports graphical user interface development as well. So if you are thinking to create something with this GUI concept as well, then you can. And just like other programming languages have OOPs concept, same way Python is also having OOPs concept. We can say that object-oriented approach as well. And this is highly portable. It means it can run on any operating system. If you are Mac user, you're good to go. If you are Windows user, you are good to go. If you are using Linux also, you can use it. That the next thing is the highly dynamic. It means it— you can specify variable, like specifying variable type is not required. Like in other programming languages, before writing anything you have to define what you are trying to write, but in Python you need not to do it. Python will automatically understand with the way that you are going to type your line. I hope up till now everything is clear and you guys are having no doubts. Coding is enough. Yes, coding is enough for like— it depends like what you are trying to create exactly. If you wanted to create a full stack development, like if you want to go for the full stack development, then coding is not enough. You have to learn about the queries like databases, you have to learn about the version control tools as well. So it depends. There are so many features that Python is having, like it's easy to write, is it easy to read, it has interactive mode, you can dynamically type, and you know, type checking is also there, automatic garbage collection is also there in Python. So there are so many, uh, features about Python. As I told you, there are two types of languages: high-level language and low-level language. Low-level languages are those which are machine friendly. It means your machine can easily understand. If I say machine can easily understand, means your computer. What computers can understand? Computer can understand— basically, if you remember in your school time, in your computer book, you might have heard that computer can understand zeros and one. When I say zeros and one, it means computer can understand the zero, one, and the combination of zero and one. So that is what machine code is, and machine can understand, which is harder to understand by the human. It means we humans cannot understand. If I'm going to write something like random, right, 11001100, it means you are not going to guess even that what I have written. But in low-level language, which is machine code, it is hard to understand for the humans, but for machine this is very much familiar language. So high-level language means easier to learn, in which you are going to write everything in the English keywords. Which makes sense to humans. Then comes in the world of coding, there are two things. One is compiler, another one is interpreter. Whenever you are going to start your journey as a coder, you should know the difference between the compiler and interpreter. Why? Because some languages need a compiler additional to the environment that you are going to download, but Python is an interpreter language. It means you need not to get any type of external compiler to run your Python code. You can simply download any application like Visual Studio Code, or you can go with the Anaconda, PyCharm, anything it could be. So it is an interpreter language which will take your code line by line and will try to give you the output. But in case of compiler-based programming languages, or in, in case of the coding where you are going to use the compiler, like C— C programming language needs compiler. So in C, you are going to what will happen exactly? It's going to take your entire code and it will evaluate all your entire code and then will give you the errors. If suppose you have written 10 lines of code and you have error somehow in line number 6, then it will show you an error that you have error in line number 6. But in case of interpreter language, it is not like that. It will be like if you have written 10 lines of code and you're passing to, you know, to execute it, then it will take it line by line. Line number 1, if it is correct, it will give you an output. If it is line number 2 and the code is correct, and it will give you the output. Same way, it will go up to line number 5, but on line number 6, as we know that we have created like maybe syntax error or any kind of error, then at that time it will throw an error, say that, okay, this line is having error. To proceed further, first you have to correct it, and then only the further execution will be done. So this is what compiler and interpreter languages will do. Do anyone have any question up till this? Yeah, do anyone have any question? Or shall we move ahead? So up till now I was giving you the knowledge of coding, that what exactly coding is, how many types of, uh, environment you are going to deal with, like a compiler and interpreter. Same way, now we are going to focus only on Python, that how exactly you need to code in Python. So coding in Python is simple, we all know, but now we are going to see how exactly we have to do. So I have simply created one folder on my desktop, and I have created one folder with the name live. Now I'm going to create a new file. I'm going to say live_1.ipynb. When I am typing ipynb, then it means I am trying to say that I am creating Python notebook. Generally, if you are using PyCharm or any Anaconda, like if you have gone through any tutorial as of now, then it means— then you might have heard about .py extension. .py extension is for Python file. .ipynb extension is Python Notebook. Python file means in which you are going to write down your codes along with the commenting. Like, if you wanted to add any notes in that file, you have to use the process of commenting. But if you wanted to have the separate code cells and separate your note cells, if you wanted to separate them, then in that case you can go with the Python Notebook. So you can get this IPYNB, you can get it with the extension .ipynb. With .ipynd you will have these section like using which you can add a code cell or a markdown cell. Markdown cell means simply you are going to write your notes, whatever is your notes is like you wanted to add any key point or you wanted to add a title, you wanted to add it, add a heading, anything it could be, then you have to use the markdown cell. And code cell is for writing your codes. Now when we are going to write down the code, first thing is to understand the environment. So right now I'm showing you Visual Studio Code. So those who are going to use Visual Studio Code can get the hands-on like I'm going to tell you. So if you wanted to add a code cell, you have a way to add it with the center, like center of your screen. From this section also you can add a code cell or you can add a markdown cell. Or else you can go with this option which is over here, add a code cell and add a markdown cell. If you wanted to run it, then you can press Shift Enter directly from your keyboard. You have to press Shift and Enter. If you are going to press Shift Enter at the same time, then it will execute that particular code cell or markdown cell for you. If you wanted to do it with your mouse, then there comes one triangle kind of icon. You have to use this icon to execute it. This is execute cell, uh, like icon. So this triangle shows that you wanted to execute this particular code cell. When you wanted to execute everything from this particular notebook which you have just created, like my notebook name is live_1.ipynb, then if you wanted to run all of these cells, then you have to use this run all button. This Run All button will help you do that. When you have created everything like a Python notebook and everything, make sure you check the kernel. So this is the kernel. For my— for me, it's showing Python 3.12 because this is the version which I have on my system. If you have any other version, maybe you are using 3.9, 3.10, anything, then it will come like Python 3.9 or Python 3.10. For me, it's showing 3.12. Any question up to now? Okay, so that was all about the platform that we are going to use, which is Visual Studio Code. Now let's understand how we are going to take it forward. First, I'm going to tell you about the theoretical part, that what and what these terms mean, all of these like basic things about coding that you should know. So let's get back to the documentation which I have created. Okay, so first thing we have already discussed is introduction to the Python. We've discussed about the features, we have already done the installation part, and if you haven't done, you can go through the video. Now let's talk about writing your first Python program. When you wanted to start writing your first Python program, generally, like, other mentors are recommending that you have to write the print statement. And simply, if you can check whether your kernel is working or not, so simply by displaying anything— it could be your name, or it can be today's date, anything you can display— then in programming, whichever language you are going to learn Now we are focusing on Python, so I will tell you how to deal with certain things in Python. So next thing that I have written is indentation and code blocks. This plays a major role in coding. You have to define something in the certain area only. If you are defining it outside of that area, you will get indentation error. Indentation means you are going to write something, write your codes within the specified area. Or which makes sense in the coding. So this is indentation and code block, as we have already discussed. Then comes commenting. Commenting means writing your notes, writing your key points. It can be your single line code, it can be your— a big paragraph about what you are doing currently, or a complete paragraph about, uh, the steps that you have followed in the code. Anything it could be. So accordingly, you can add your comments in your notebook. Now, when adding your comments, it goes under single line commenting and, and multi-line commenting. So let's first see how we can test our kernel. To test your kernel, you simply have to say print bracket begins within quotes, you can write anything. So I'm writing, I am learning Python. So whatever you wanted to display, you can just write it and you just use this triangle to print it. If this is giving you an output, it means your kernel is working fine. You have successfully installed your Python on your system. So now look at the way that I have written. I have written print bracket begins, within quotation I'm writing, I am learning Python. So what I wanted to print is I wanted to print this section that I am learning Python. This is a message that I wanted to display. In terms of English, we can say this is a text that I wanted to display. But in terms of programming, when I talk about messages, when I talk about text, then it means I'm talking about strings. String is a word that is used in programming to showcase any text, any kind of character, alphabetical character or a special character. We say string. Then I have written it within print, print in the lowercase. Print, p is in the lowercase, r is in the lowercase. Entire print I have written in the lowercase. So make a note that Python is a case-sensitive language. Case-sensitive language means whatever you are writing, the way that you are writing, you have to follow the same way. If you have written it in the lowercase, go ahead with the lowercase. If you have written it in the uppercase, go ahead with the uppercase. So this you have to make a point. So this is how you can directly print it. Now if you wanted to add, I will show you another type of file which you might be using. So you add a new file. I'm going to say live_1.1.py. .py means I am creating a Python file on my system. So I have created this file. Over here I'm going to write down the same code in this file itself. And if I wanted to run it, I have to use this run button. And in the terminal, you are going to get that output. So you can see in the terminal, I'm getting this output. But in case of Python notebook, you are going to get the output just below the code cell you have executed. Now let's see how you can add your commenting, how you can add your notes while you are writing your codes. So if you are using .py file, then it means you have to use the structured way of commenting. That is, if you are going with a single line, like if you wanted to write something within single line, then you have to use the method which is hash. You have to add hash in the beginning of the file or wherever you wanted to start it, like In line number 3, I have added a hash and then I have written single line. So this is one way of commenting. If you have a single line, if you have a single sentence or anything, then you can use a single line. Then next is multi-line. When you wanted to write something in multiple lines, multiple line means, let's say, I'm saying, I'm writing, I am 'Learning Python.' I am learning Python. This is what I have written. When I'm saying I am learning Python, I have used 4 lines— 5, 6, 7, 8. This is the line number. So if you are going with the multi-line, it means you are using more than one line, then you have to use triple quotes to keep it as a commenting. Now, how your kernel will behave with your commenting? So when you are writing the codes, it means you are trying to execute it and you wanted to display it, either, or you wanted to store it in the computer's memory, or you may be developing something. But when it comes to commenting, then your kernel is going to ignore it. So kernel will ignore two types of things. First, the sentences where hash is added. Second, the sentences, uh, where triple quotes has been added. It can be either single quote or it can be either double quotes. It depends how you wanted to define it. Just like I have written the same thing in the double quotes, I can copy it and I can write it within single quotes as well. Instead of using triple double quotes, I'm going to use a triple single quote. So this way also you can define it. This is commenting. When we are writing the comments, you have to make sure you are writing the same thing. Like, you cannot do it like you have opened 3 single quotes and you are closing it with the 3 double quotes. No, you have to open the same type of code and you have to close it. So single line means hash and multi-line means triple quotes, either single quotes or double quotes. Only these 3 things will be ignored by the kernel. Otherwise, you will get the errors, maybe name error or maybe syntax error. Most probably you are going to get the syntax error because this is wrong, like this is not from the Python syntax. This is how you can write your commenting, or how you— this is how you can write your notes in .py file. If you are using .ipynb, then in this case you have to use the— you can use the markdown syntax. You can also use the same method, like which is hash method. So you can say I'm learning within the hash. And if you are going to execute it, you are not going to get it in the output. Or let's say, let me just change it. I'm going to say run. I'm using Visual Studio Code, right? So now I have written 'I am learning.' Only I'm, I'm getting 'I am learning' in the output. I'm not getting this sentence because I have added a hash in the beginning. Hash means this sentence will be ignored by the kernel. Whenever any sentence is ignored by the kernel, then it means you won't get it in the output. Any question up till this? Yeah, anyone, any question? So simply use the print statement and write everything within the quotation to print it. When it comes to print any number, then you need not to mention it in the quotation, because when you are writing something within quotation, it means you are defining a string. But when you wanted to just print a number, you need not to use the string. You directly write this and write down the number that you wanted to print, and you execute it. Print bracket begins and 85, and you can see we are getting 85 in the output. If you are adding a hashtag after writing your commands, like suppose I'm writing over here printing a number, then that particular word which I have written, that particular sentence that I have written, printing a number, will be ignored because I have added a hash in the beginning of that particular sentence. So that's how you can make a difference between the code and your notes. Not just the notes, if you are going with the data analyst role, then obviously after creating any graph, or if you are creating anything like you are— maybe you have done any data analysis, you have extracted the meaning of the dataset that you have, you have extracted how many rows you have or how many columns you have. Then after that, obviously you have to mention it in the non-tech terms as well, so that whenever you're going to present the insights to the non-technical team, that makes sense to that team. So every time when you have to write down your insights in English keywords or in English basically, so you can use the method of commenting. Generally when we create data analysis or data science project, we use IPYNB because .py is not used in this analyst or, or— so that's how you can print a number and you can print a normally a number and a string. Now there are multiple data types in Python. There are different, different data types in Python. The number one data type is the string data type. String data type, as we have discussed, which means a character, a special character, text, paragraph, or any PDF— everything comes under string. Second is the numbers. Numbers are different types of numbers we have. So first type of number that we have is the directly whole number. When we are dealing with whole numbers, you can directly print the whole numbers just like I have printed. Print 85. 85 is the whole number. Second type of, uh, second data type is the numerical, like under the numeric data type category, which is decimal. So decimal means point, like you have written 1.2, 1.5, 9.5, anything similar to this is the float data type. We call it float data type, same as the decimal. So we know, we already know decimal numbers from the mathematics., but now in coding it is known as float. So we have another type of a data which is float data type. So if you are going to say print 1.3, then it will print 1.3. And this is the different data types. Another data type is the complex numbers. Complex numbers means a combination of imaginary number and the real number. So you might have learned it in the 11th or 12th classes of your school. It's the imaginary— like if I'm writing 7i 45, so this is a combination of imaginary number where you don't know the value of i and you have written 45, which is a real number. You know what 45 is, but you don't know what i is. So 7i means this is an imaginary number. I can be anything. So this is what we call as a complex numbers. This is the float data type. Yeah, anyone, any question up till now? Okay, now let's learn the next topic, which is variables. So variables means it is a kind of a container that you can use to store anything in the computer's memory. So if I wanted to store my name, I have to— if I have to store it in the computer's memory, then I have to store it in some container, and that container I have to assign. So it can be any kind of a container. That is like, you can say from the real world also, you can, uh, like, this is a realistic example. Like, if you wanted to store water, then you need a bottle. If you wanted to store chocolates, you want the box. Same way, if in the computer's memory also, you have to give it a name. So If I'm storing a number, let's say someone's age, so I can say that age is the container. Or if I'm storing someone's grade, so I can say grade is a variable, grade is a container. So variable means it's going to serve as a pointer to an object. Like whenever you wanted to get that object, you have to use that particular pointer to get that object. So whenever you have created an object, you have to give it a name. Whenever you wanted to create an object, you wanted to assign a variable to it, then you have to— it because like whenever you are going to call it, you have to call it with the same name. So for example, you can say that if I am going to write age is equal to 14, then age is a variable, equal to is the assignment operator, and 14 is the value which you have stored in that particular variable. You can change the variable's value also. Like if you have defined age is equal to 14, but now you got to know that person's age is not 14, that person's name is 16. So it means you can add directly 2 to the existing value of the age and the age value will be updated. But there are some rules to define Python variable. The number one rule is that Python variable must start with the letter. You have to start writing the name like whenever you are defining the variable, you have to start with the letter, or else you can start with the underscore character as well. Second thing is which you have to avoid, that Python variable cannot start with the numbers. You cannot write numbers in the beginning. You cannot say, suppose there are 10 students and you wanted to store the name of all 10 students, so you cannot say that, okay, 9th age. No, this is the wrong way of defining. Numbers cannot be the first letter of any variable. You can use underscore, or else you can use the alphabetical character, but numbers you have to avoid. So in the beginning, you can only use letters or underscore, and you don't have to use numbers. Then comes alphanumeric characters and underscore. Entire, entire variable which you are going to define can contain alphanumeric character and underscore. Any other character than underscore you cannot use any special character like dollar symbol, percentage symbol, hashtag? No, those special characters are not allowed in Python. You have to define variables only with 3 things. First, alphabetical characters. Second, numeric characters. And third, the underscore. Only 3 things. Fourth, variables are again case sensitive. So if you are writing anything in the lowercase, it means that will remain in lowercase. So if I am writing age is equal to 14, that is the first variable. If I'm writing A capital H is equal to 15, that is a different variable. If I'm going to say all in caps, that is again a different variable. You can— okay, wait, you can say A and G in the capital and e in the lowercase, this is again a different variable. So it is a case-sensitive language, so variables are also case-sensitive. All three are going to be the different variable, all three are going to be the unique variable. Okay, now there is one more exception in defining the variable. That exception is that you cannot define a reserved word from Python as a variable. Reserved word means there are certain words which has been used to define Python. Obviously, Python is a programming language which is not, uh, the, you know, nature created. This is man-made created, like Humans have created Python programming language. So while creating Python, they have reserved some words, they have used some words to define everything within Python to work. So you cannot use those words, you cannot use those reserved words from Python. Those words are also known as keywords. So you cannot use those keywords as a variable to store anything. You have to use something different, something unique. At the same time, you have to follow these rules as well. Whenever you wanted to assign a value to a variable, you have to use only one operator, which is assignment operator. Assignment operator means equal to symbol, which you have written, which I have written on my screen. Age is equal to 17. Age is equal to 16. 16, age is equal to 50. Same equal to, equal to, equal to, you have to use to assign a value. You can also use other operators, we will discuss this later, that if you wanted to upgrade the value, if you wanted to decrease something from the value, then how you can do it. You can do those things as well, but we will discuss it later. This is called declaration or initialization, you can say. If you wanted to redeclare something, then you have to redefine it in the further Suppose I have already defined age is equal to 14, but now I think age is equal to 16, so I can redefine it. Only the latest cell value will be stored in the memory, not 14 and 16. Both values will not be stored. Only single value, which is the latest code cell value which you have executed, will be stored in the computer's memory. It can be any number, it can be integer, it can be float, any data type you can use to store the values. If I wanted to store the name So I can simply say name is equal to, let's say, Python. I've written it within the code cell. If you wanted to change the code cell to Markdown cell to code cell, you have to right-click and then there comes Change Cell to Code. That's it. Now I'm going to say in the caps, name is equal to Visual. Then I'm going to use first two letter in the caps is equal to code. So I have written 3 different variables, and all 3 variables have 3 unique values. So all 3 will, you know, behave differently. And whenever you're going to call within the lowercase, you will get the value which is stored in the lowercase. And same goes for the other as well. So anyone else, any other question? So this is how you have to declare a variable. Now let's— which one do you want me to repeat, Prashant? The rules for the variable. Okay, let me write it in the markdown, sir. So there are certain rules that you need to follow to declare a variable. So rules for variables are: first thing is you need to use alphanumeric characters and underscore to declare a variable. Second is alphanumeric character, and you cannot use reserved words from the Python, that is keywords. Variables cannot— you cannot use numbers in the beginning of the variable. So these are the 3 conditions, and the 4th one is the simple one, that this is case sensitive. Python is case sensitive. So name comma capital name or name or this will act as a different variables. So you have to define it accordingly. You can store any data types in variable. You can update the value of variable as well. And if you wanted to define different values to the different variable within the single line, that too can be done. So let's say I have 3 values. So let's take an example: 14, 15, 16, 17. I have these 4 values and I wanted to store it in the variable at once. I don't want to use all 4 lines, I wanted to write it within a single line. So what I can do is— I'm showing you in the .py file. So you can say, let's say my variable names are a, b, c, d. So you can use a single equal to, but as you have written 4 variables, then you have to make sure you have— you are writing 4 values as well. So it's 14, 15, 16, and 17. So within single lines, I have declared 4 different variables: variable a, variable b, variable c, and variable d. Now if I am going to run this code file, all the values are stored already. Now I have to print it, so I will just print it line by line. Print variable a. When you wanted to display something from the variable, you need not to write it in the quotation, you directly have to write down the variable value because now that variable is a stored container in the computer's memory and that is acting as an object. So you need not to write within quotation. Quotations are required when it is something related to— so print c, print d. So all four variables will be displayed. So you can see I have four variables: 14, 15, 16, and 17, because I have printed it in the same manner. If I am going to rearrange the print statement, like I'm first— I'm printing c variable, then I'm printing d variable, then a, and then b. Now if I am going to run this, then it will print in the same manner, like C is for 16, D is for 17. So according to the sequence that you have written the numbers in, the values will be assigned respectively. Like for A, the first value will be assigned, which is 14. For B, value 15 has been assigned. For C, 16 has been assigned. And for D, 17 has been assigned. So if I am printing c first, then I will get 16, and which I am getting as well. So whenever you are declaring the variable within the single line, you have to make sure you are writing the same number of variables and number of values. Do— both should match. If you're writing 4 on the left and 3 on the right, then you will get an error. Let me show you which type of error you are going to get. Programming without any error means You haven't coded. So now if I'm writing this, now I'm going to run this. Now you see it shows ValueError: Not enough values to unpack. Expected 4, got 3. The error directly tells you what you have exactly have to do. You're not able to see the screen, is it? Let me just stop and reshare. Let me know if it is visible to you now. All right, so let me just repeat it, that when you are storing everything within the single line, like you wanted to store multiple values in the single line, you have to make sure that you are going to use same number of values on the left-hand side and the right-hand side of equal to. So for example, if you wanted to store 4 values, then you have to declare obviously 4 variables. When you have declared 4 variables, you have to make sure you have to mention 4 values on the right-hand side of the equal to also. If you are going to write anything less than that or anything greater than that, then in that case you will get these kind of error, which is a ValueError. So you simply have to read the error, what error is trying to tell you. So error is trying to say that not enough values, right? Not enough values to unpack. Expected 4, got 3. It means you have passed 3 values and it was expecting you to enter 4 values. So you have to now update the variable, like you have to update one more value in it. Now you can say these are the 4 variables, variables, and these are the 4 values. So that's how if you are going to define, you won't get the error. So this is the first error, which is ValueError, which we have got up till now. If you are going to write something in the wrong syntax, now let's say I'm going to say print print bracket A. But this time I'm going to make a mistake in writing the print. I have written PRINT P in caps and other letters in lowercase. Obviously your environment will try to tell you that you have made a mistake, but if you still— you have not— like, you are ignoring it, then if you are going to run this in the terminal also, you are going to get an error. Now it says name error: name print is not defined. Do you mean print. Did you mean print? Now first, what your kernel is trying to predict is print is a name, print is a variable name, function name, any kind of name your print is. But what we were trying to write is we were trying to display certain things. So display means— now then the next statement says that did you mean print? Did you mean print means now Python kernel is saying that okay, you wanted to display play something with the print, maybe. So you have to write it in this way. This is the correct syntax. So this is name error. If suppose you are writing the correct way print and then you have written extra comma, or you can say a colon or something, and if you are going to now run it, now you will get a syntax error because now your Python kernel knows that, okay, you are trying to print something, you are trying to display play something, but there is something wrong within the brackets, within the syntax. You have written something extra. So this is syntax error. It means you have written invalid syntax. You have to, you know, follow the correct syntax. If you are going to follow the correct syntax, then only you will get it printed. So it simply shows you an error also that this is wrong. If you are going to remove this Then also this is bit correct because only the comma is extra. Comma is used as a separator in Python, so you won't get any error. Anyone, any question up till now? Any question up till now? Shall we proceed ahead? Yeah, anyone, any question? Now let's see how we can print something with the message. Now let's say I wanted to print all these 4, like all these, uh, print statements that we have written with a meaningful way so that whoever is going to view it, that makes sense to that person. So simply what you have to say is, if you have written print bracket begins, and over here you wanted to add some text, as I told you in the beginning of the session, whenever I say text you have to use quotation. So simply you use quotations and you write down your message. So suppose my message is the value of the variable c is— this is the message that I wanted to print. So simply I have written the value of variable c is within quotation. You can use any type of quotation, single quote or double quote, but you have to make sure if you are using single for opening, then you have to close also the single quote. You don't have to use the different one. So now I've written the value of variable c is, and then I have written a variable. But there comes one more thing which you have to add in the print statement, that is a separator. Separator means that is, uh, which is going to separate two things. Right? In simple terms, we all know separator means which is going to separate two things. First is your text, another one is your variable. So when you wanted to separate your text from your variable, you have to use comma as a separator. Same thing you can do if you wanted to continue writing. Suppose you have written the value of variable c is this, which I have stored So now what I have done is I have separated all three things. First, I have separated first string from the variable. Then I have separated variable from the second string. I have two strings. This is value from the variable which I have used for, you know, storing that value. So this is the text which I am separating from the variable using comma. Then this is the second statement which I am again separating with the comma. So you have to make sure if I'm going to miss any of the comma, then also it will give you this red color line which shows that, okay, you have missed something, syntax is wrong. If you are going to run this, you will get syntax error. So you can see this is syntax error, invalid syntax, and this shows an error towards the last string because you have not separated it. You have to separate it with the comma. Comma is a by default way in Python to separate it. Now if you are going to run, you are going to get the complete statement printed for you. It is like if you wanted to make some calculation also, you can display that as well. So you can say, let's say I'm writing the value of variable d is, and then I'm going to display the value of d, comma But if, when, if you multiply D with the variable C, then it will give us comma C multiply by D. So simply I am doing a basic calculation, that is multiplying two numbers. We all know that we have already stored numbers in the variables. When you have stored numbers, then only this execution will work. Otherwise this will return something weird to you, weird in the terminal. Okay, so I have written the value of the variable d is, then I have added a separator, then I have written a variable, then added a separator, then again I have written a complete sentence, then I have added a separator, and then I am using c multiply by d. You can do any kind of calculation within the Python kernel. So now I'm going to run this. Now you can see the value of variable d is 17, but if we multiply d with the variables c, then it will give us 272. You can also write down the value of c to make it more meaningful. The value of variable d is this, and the value of— within quotation— and the value of variable c is comma c comma Quotation begins. Now if I'm going to run this, I will get 2 values. I am getting the value of variable d is 17 and the value of variable c is 16. If you are going to multiply 16 and 17, then you are going to get the 272 as a value. Ashish, now you can see my screen. Now the screen issue is resolved. So that's how you have to display all the variable values, and that's how you can display the variables along with your message along with the text that you wanted to display. And along with that, you can do any type of calculation as well. You can use your Python kernel as a calculator and can create a basic simple calculator with the help of the variables, values, data types, print statement, printing multiple things with the help of separator. If you are going to combine all of these concepts, then you can simply create a simple calculator. A very basic simple calculator you can create. I think there is some system issue with you, like due to which you all are not able to view my complete screen. So we will connect tomorrow at the same time. Until then, bye-bye, and try to revise everything, and we will take it forward from this concept itself.










