 Hello and welcome to the introduction for this course. What are the course requirements? You need a computer and internet connection to follow along with this course. Who is this course for? This course is for anyone who wants to learn something new. What is the course format? The format of the course is video. Hello and welcome. In this video, I will briefly be introducing you to what programming is. What is programming? When you hear the term programming, all it is basically is a set of instructions that you provide to a computer to carry out some tasks or activity. So programming in a nutshell is a set of instructions that you give to a computer to do. So a computer program is basically a bunch of instructions to the computer to action. A computer is basically as clever as you make them to be. So when you're giving instructions to the computer, you'll have to provide the instructions in a sequence of steps. So it's very important to tell the computer which steps to follow and in what sequence. The problem is if you don't give the correct instructions to the computer and the right sequence, you will not get the desired results. Now the instructions that you provide to the computer are known as statements. So you can look at the computer program as a collection of statements. The sequence of steps that the computer follows are referred to as algorithms. So it's good to take note of these buzzwords. So as you begin to learn programming, when you come across these words, you will know what they mean. So we know that programming is a set of instructions that you provide to the computer. Now the instructions have to be written and they are written in what is referred to as a programming language. Now there are several programming languages out there depending on what you want to do or which languages you are comfortable with. Normally most computer programs are written in what is called a plain text editor. So just like you would use Microsoft Word to write text, if you want to write computer program, they are written in a plain text editor. The reason it has to be a plain text is because you don't need any formatting just like Microsoft Word that has formatting on it. The text editor has to be plain. There has to be no formatting at all because you don't want the instructions to be formatted. You want the instructions to be written exactly how you want the computer to follow it. Once you have written your instructions with a programming language inside a text editor, the content of that text editor is then referred to as the source code. So often you hear programmers say, let me see the source code. So what they actually mean, they want to know to see the content of the text editor where you've written the instructions for the computer. So it's very important to know the various keywords I've used here. I've purposely made them bold so that it stands out. So when you come across these buzzwords, you know what they stand for. I've got an illustration here of a computer programming. So in this example here, I'm getting a robot to make a cup of tea. So when you're providing instructions to the computer, you need to provide it in a step-by-step sequence for the computer to follow. This is referred to as an algorithm. If the steps are not followed in order, then you will not get the desired results. So for example, if you reverse the steps, then you will not get the desired outcome. So if any of this step is reversed, for example, if you boil the kettle first and then later do the other steps, then by the time you get to it, the cup of tea might be cold. So it's very important that when you provide instructions to the computer, they are clear, they are precise for the computer to follow. Don't forget that the computer is just a DOM terminal. So it's as clever as you make it out to be. It will do exactly what you tell it to do. So it's important that when you write programs, you make sure that your instructions are clear for the computer to follow. I hope this video has given you a clue or a better understanding of what programming is. Thank you for watching. Bye for now. Hello and welcome to this video on what is Python. Python is a general purpose programming language. This means it can be used to write computer programs for various things like games, data science, websites and so on. Python is also a high level programming language. High level programming languages mean that the languages of writing computer instructions in a way that is easily understandable and close to human language. Python is portable, which means we can run Python programs in the various different operating systems like Windows, Mac OS, Linux without any changes. Python is an interpreted language. Python is called an interpreted language because it goes through an interpreter which turns code you write into the language understood by your computer's processor. Python is strongly typed. Strongly typed languages don't convert data from one type to another type automatically. Python has a huge set of libraries. A Python library is a collection of programs you can incorporate into your own program without writing code for them. Let's take a look at a list of application types you can create with Python web applications. These are applications you can access using a web browser, Android applications. These are applications that runs on Android devices like Android phones and tablets, games. You can create various types of games with Python, scientific applications. You can create various types of scientific applications with Python, system administration applications. So you can use Python to create applications to monitor various types of systems. You can also create console applications. A console application basically is a computer program designed to be used by a text-only computer interface. Let's take a look at a list of software applications that have been created using Python. So some of these are quite famous and popular. First on the list is YouTube and then we have Google. We have Dropbox. This program lets you save files to a cloud-based service that you can then access from anywhere in the world. We've also got Reddit. Reddit is one of the biggest open communities on the web. You have a question you want to talk about, something in specific, or if you want to find tons of information regarding a particular topic, for example, gardening or anything, you can just look on Reddit and find related information. Next we have Spotify. Spotify allows you to listen to ad-free music of your choice. This is streaming service that allows you to stream music without any advertisement. Finally, we've got Instagram. Instagram is very popular. It has both an app site and also a web site as well. And these are just a few list items of software that were created using Python. There are so many others, but these are just some few that you may have come across. So that is it for this video on what is Python. Thanks for watching. Bye for now. Hello and welcome to this video. This video is about how to download and install Python on Windows-based computers. To check if Python is installed on your computer, you need to open up the command prompt and type in the following command, which is Python space dash dash version. I have got my command prompt open. So I'm going to type in the command Python space dash dash version. And then you press enter. You should get this message displayed saying Python is not recognized as an internal or external command. This proves that you haven't got Python installed. So I'm just going to exit out of this command prompt by clicking on the X and we have the website for Python. So this is the official website to download Python. The link is displayed on the screen that will give you access to the download page of Python. So click on the downloads tab, which is this tab here. And the current version as of the time I am recording this video is Python 3.72. Next, you can click on the button that says Python 3.72 to begin the download. So click on that and the download should begin. So you can see the download here on the bottom left hand corner of the screen. So we'll give that a few minutes to complete the download. The next thing we're going to do is install Python from the downloaded file to begin the installation. On the bottom left hand corner is the downloaded file. Just click on it to run the Python installation and you'll be presented with this screen. I'm just going to minimize the other screen so we can see the installation screen properly. The setup screen provides some information as to where Python is going to be installed, which tells you this is where it's going to be installed for me. It also tells you what else is going to be installed. So it says it's going to install idle and it's going to install pip. Next on the bottom here, we've got a box that says add Python 3.72 path. Make sure you click inside that box to make it checked. And then once you've got that box checked, click on this install now button to begin the installation. So click and that should start the installation. Once the installation is finished, you will get the message saying setup was successful. You can just click to close the setup box. Next thing we want to do is check that Python is installed. To check that we have definitely got Python installed, we need to type in the following command inside the command prompt. So you type in Python space, you do dash dash version and then you press enter and that gives you the current version of Python. You can see it displays version 3.72. So this concludes this video on the download and installation of Python. Hello and welcome to this video. In this video, I will show you how to install Python 3 on a Mac. By default, Python comes pre-installed with all Macs, but the version is quite old. So it comes pre-installed with version 2.7. The current versions of Python being used is Python 3x. So let's open up our terminal to check the version of Python that we have installed. So this is my terminal. So you type in Python, you do a space, dash dash version and press enter and that gives you the current version installed on your Mac. So this is a version that comes pre-installed. It is possible to have both version 2 and 3 installed. So version 2 and 3 can coexist on the same machine. So let's go over to the official Python website and download Python version 3x. X, meaning the current version. As of the time of recording this video, the current version of Python, if you go to downloads, it gives you the current version. So the current version is 3.7.2. All right, so to begin the download, just click on the button and it will just drop the download in the download folder. We give it a few minutes to complete. You can see it here, it's downloading. So once that blue bar is completed, we know that it has completed the download. So just give it a few minutes to complete. So once the download is completed, you can see here it gives you a little brown box on the bottom, just click on the brown box and it shows you what's in there, which is a PKG file. So it tells you open and finder. So click this to open it in finder. Now this is what was downloaded. So just double click on it and that will launch the installer. So I'm just going to minimize everything else so that we can have access to the installer screen. So feel free to read through what's on the screen. Click continue. You can scroll through and read through all this. It just gives you some important information about the version. Click continue and you can check out the history and the license if you've got time to do that. Otherwise, click continue and you need to agree to the license agreements before you can progress with the installation. So click agree and click install. It will prompt you for your password. So enter your password and click install and you can see here it started the installation. So I'm just gonna give it a few minutes to complete the installation. Installation is complete. So these are all the stuff that it basically installs. So when you install Python, it also installs all this, the idle and everything else. So I'm just gonna exit that at the moment. It's just telling you what it has installed and then here it tells you the installation was completed successfully. Congratulations Python 3.7.2 for Mac OS 10.9 or later was successfully installed. So feel free to close the box and it tells you here, do you want to move the Python installer to the trash now that we've completed? I would say yes, move to trash because we've done the installation. Next thing is to open up the terminal and let's check for the version of Python. But to check the version of Python that we have installed, we need to type in Python 3 under the space dash dash version. If we typed in just Python, it will return Python 2, which we don't want. It tells me I've got Python 3.72. If we were to just type in Python and do a space dash dash version and press enter, it gives you version 2.7. So it's very important when you are trying to develop or create things in Python, you have to use the correct version of Python that you are referring to. For example, if I wanted to do something interactive and I typed in Python to give me the Python shell and I can do a simple maths, I'll do six plus six and press enter, it gives me the answer of 12. Now, if I want to exit, this is called the Python shell. If I want to exit that, I type in exit and parentheses, press enter and that will exit the shell. If I need to clear my screen, I type in clear and that clears the screen. Now, if I want to access Python 3 shell, I type in Python and then three. If you notice, it tells me here, Python 3.7.2. So very important to type in the correct version of Python when you are trying to develop or experiment. So again, we can do a simple maths and do eight plus seven. It gives you 15. So we just exit, type in exit and then the parentheses and that will exit the Python shell. So this concludes the installation of Python 3 on a Mac. Thanks very much. If you had any problems during the installation, please feel free to let me know. I'll be more than happy to help out. Thanks and bye for now. Hello and welcome. This video is about how to download and install PyCharm on a Windows-based computer. What is PyCharm? PyCharm is a Python IDE. IDE stands for Integrated Development Environment. So PyCharm can be used to create applications that are written in Python. It allows you to write, to run and test your application from within the IDE. PyCharm is widely used by Python developers. It is cross-platform, which means it can be used on a Windows, a Mac OS or a Linux-based computer. PyCharm is developed by a company called JetBrains. PyCharm can be downloaded from the link displayed on the screen. To download PyCharm, you need to click on the download button, and that will give you two options. You've got the professional and the community. The professional is a full-featured IDE for development and can be used on a trial basis before you pay. But eventually, after your trial expires, you'll be expected to pay for it. We've also got the community version, which is a lightweight IDE that can be used for Python and scientific development. So that is the option we are going to go for. So I'm gonna click on the download button to begin the download for the community. You can see the file here being downloaded on the bottom left-hand corner of my screen. Next, let's install PyCharm from the file that was downloaded. So the bottom left-hand corner is the PyCharm file that was downloaded, so I'm just gonna give it a click to run the installation file. So give it a few minutes and it should pop open a screen. You may get a user account control and just click yes or click run and that will give you this setup screen. Click Next and just accept the destination. It tells you the space required, the space you have got. Click Next, all right, and then you can create a shortcut on your desktop if you wish to do so. So you have a 32-bit launcher or a 64-bit launcher. So I'm gonna click on that to create an icon on my desktop. You can also update the context menu if you wish to do so, but I'm only going to leave that. You can also update the path variable if you need, but if you click that option, you will need to restart your computer. So I'm gonna leave that for now and I'll click Next and I'll click Install. And that should begin the installation. So you can see here is dropped the icon on my desktop. So we wait for it to complete the installation. Once the installation has been completed, you get the screen saying Completing PyCharm Community Edition Setup. So you can either run it by checking the box or you can finish. So I'm just gonna click to finish. And that is my icon. So that is it for this video. In this video, I downloaded and installed the Python IDE called PyCharm. Many thanks for watching and bye for now. Hello and welcome to this video. In this video, I'll be showing you how to download and install PyCharm. PyCharm is a Python IDE. It stands for Integrated Development Environment. It's a tool that has all the tools that you need to develop various types of application. We are going to download PyCharm from the JetBrains website. JetBrains are the developers or the makers of PyCharm. So let's go back to the JetBrains.com website. And they also have other tools, not just PyCharm. In this video, we are gonna focus on PyCharm. So these are all the IDs they do. So I'm gonna click on PyCharm to take us to the PyCharm page. And once you're on the PyCharm page, just click on download. PyCharm comes with two versions. So we have the professional version, which is fully fledged. This is paid for, but it also allows you to try it out for a while. And then we have the community version, which is lightweight, but is completely free. So I will be downloading the community version. So I just click on download to begin the download. So we'll give it a few minutes and that should start the download. And the download should have started. You can see this is the download bar. So once that bar completes to the end, that means it would have downloaded it. And then we can go ahead and run the DMG file, which will enable us to copy the PyCharm application into our applications folder on our Mac. Once the download has completed, you should see that in your downloads folder. So if you click on your downloads folder, it tells you the name of the file that was downloaded. So let's open it in Finder by clicking on this. And that is the downloaded file. So I'm just gonna minimize this other screen so we can see the screen properly. So I'm just gonna double click to extract the DMG file. And once that is extracted, we should be able to just drag it into our application folder. Just gonna double click again to make sure. All right, so it's doing it now. Just give it a few minutes to complete. So it's completed the extraction. We just need to drag this into the applications folder to complete the installation. So I'm just gonna drag and drop this copy in it. So that has completed. I'm just gonna exit. Now if I open up Finder, we should be able to go to the applications folder and you can see we have PyCharm CEC is a community edition. So this concludes this video where we downloaded and installed PyCharm. Thanks for watching and bye for now. Hello and welcome. In this video, we are going to download and install the Atom text editor. What is Atom? Atom is a free open source and modern text editor. By open source, I mean its source code is open for developers to contribute in making it better. The Atom text editor is cross platform. That means it will work across multiple platforms like Windows and also a Mac. The functionality of the Atom text editor can be extended by installing various types of extensions. You can download Atom from this link, which is atom.io. The link takes you to the homepage of the Atom text editor where you can download and learn more about the text editor. This is the homepage of the Atom text editor. To download, there should be a download button. Here you go. Depending on your operating system, if you're running a Mac, it will present you with the relevant download button. I'm running a Windows, so I'm gonna click on this to begin my download. So that's the download there. I'm gonna give it a couple of minutes to finish downloading. Then I'll run the installation files. The files are finished downloading. So I'm just gonna double click to run the Atom setup file. So click and it's trying to prepare the files for installation. We just give it a few minutes to get there you go. It's trying to launch. So what's happening is the editor has been installed at the moment. You can see it tells you here Atom has been installed and it will launch once the installation is completed. Once the installation has completed, it automatically also launches the text editor. And this is the default screen that you are presented with when you first install the editor. So you've got different options here. You can, for now, it tells you here that Atom is not currently set as your default handler. You can skip that and go back to it later. So just click on X. So this is the default screen. And in this palette here, if you wanted to extend the functionality of Atom by installing different packages or extensions, this is where you will go. So you've got an option here to install a package. Atom has several packages or extensions that you can use to extend its functionality. As you begin to use the editor, you may come across useful extensions or packages that others have used. And you may want to install it yourself. And this is where you will go to install that. If you want to choose a theme, if you don't like the default theme, you click on this button to change it. And if you want to integrate with GitHub, it integrates nicely GitHub and Git, which is a version control system. And if you want to open a new project, there's a tab here to open up a new project. So that's it for the installation of the Atom text editor. Thanks for watching. Bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to the command line interface. What is the command line interface? The command line interface is a text-based application for giving commands, for viewing, for handling, and also for manipulating files on your computer. The command line interface comes pre-built into your operating system for free. The command line interface is referred to as different names in different operating systems. On a Windows-based computer, the command line interface is known as the command prompt. On a Mac OS computer, the command line interface is known as the terminal. And on a Linux-based computer, the command line interface is known as the terminal or the terminal emulator. You will be interacting with the command line interface at some point, either when you are writing computer code or when you're trying to interact with your computer to perform some actions. So that's it for this video on the introduction to the command line interface. Hello and welcome to this video. In this video, I'm going to briefly explain what Python expressions are. What are Python expressions? An expression is basically anything that has a value. It could be a number. It could be a text, which is also called a string, or it could be adding two numbers together using an operator. So an expression can contain an operator like three, plus four, the plus here is an addition operator. It can also contain upper hand. The upper hand is basically the actual values, like three is an upper hand, four is also an upper hand. Statements are made up of one or more expressions. So let me illustrate some basic expression. I'm going to be using the command prompt on my Windows computer. If you're on a Mac, you can use the terminal. When you're on the terminal on the Mac, you need to type in Python three. If you're on a window, just type in Python and press enter and that gives you access to the Python interactive shell. So the first expression I want to write here is just to add two numbers together. So I'll say three plus four and I press enter and I get seven back. So the beauty of the interactive shell, it gives you a response to what it is you are typing in. Let's do another one. So I'll do three times three and press enter. That gives me nine. Let's do a text this time. A text is basically also known as a string. So I can just say hello world. And if I press enter, it gives me back hello world. Again, I can use a variable. A variable is something that stores data. So I can create a variable. I can say B equals two. You use the equals two to assign a value. So I can say I want B to store the value of eight. Sorry, value of seven plus seven and I press enter. Now if I call B, B will give me 14 because that's the value of adding seven to seven. So these are just some basic examples of what an expression is. So that is it for this brief video on Python expressions. Thanks for watching. Bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to what a Python statement is. What is a Python statement? A statement in Python is an instruction to the computer to perform a specified action or task. In Python, a statement can be a single line or it can be multiple line. Also, you need the Python interpreter to translate the statement you write for the computer to understand. The Python interpreter is automatically installed when you install Python. Let's take a look at how a single line statement can be written. Before you can write a statement, you need to invoke or activate the Python interpreter. So if you are on a Windows-based computer, you can open up your command prompt. If you are on a Mac, you need to open up your terminal. If you're on a Mac, you need to type in Python three. Once you have your terminal open, if you are on a Windows, just type in Python and then just press enter and that will give you the Python shell. So once the Python shell is activated, automatically the Python interpreter becomes invoked or active. So to write a simple single line statement, basically I can just do a simple arithmetic. I do seven times seven and press enter. That is a single line statement because it's on a single line. So if I press enter, it gives me the answer. I can also use a print statement just to print out a single line of text. So just inside the opening parentheses, I will specify the text. I want to print on the screen, which is hello. And then I'll close the parentheses and if I press enter, it will just print out the text hello. So these are a couple of examples of a single line statement because they are statements that are written on a single line of code. Let's take a look at how we can write a very basic multi-line statement to write a multi-line statement from the Python shell. You need two characters. So you can use the slash character. If you want to write multiple line or you can use parentheses to write multi-line statements. Also, if you're using a text editor or an integrated development environment tool that has a text editor, you can write thousands and thousands or even million lines of code inside a text editor. But the illustration I'm going to show you is just gonna be with the Python shell. So in my Python shell, if I want to write a multi-line statement, for example, I could say B is equals two and then you use the slash and you press enter and that allows you to add more lines. So I can just say 17 and I do a slash again and I press enter and I can just add one more. I just say plus 16 and I press enter. Now if I refer to B, it will give me the total of the addition of all the numbers. So that's just a simple way you can implement multi-line. You can also use parentheses. For example, I can say C is equals two and I will have the opening parentheses and I press enter. This allows me to enter more line of code. Okay, so I just say plus, I press enter and I can just add another number. Let's say 20, I press enter and then I can just close the parentheses and press enter. Now if I type in C to give me 30, which is a total. So that's one example. Let's try and do an example that involves a string or a text. So let me say greetings. What I can get this to do is to store some information. So I'll say equals two and I'll just say hello and I'll do a slash to give me another line. And in this line, I'll add another text. I'll just say, I wish you the best. That'd be another line. All right, and then I can just press enter and that ends that. Now if I call greetings, it would just tell me what I have stored. So these are just some ways that you can implement the multi-line and single line statement from the Python shell. Thanks for watching and bye for now. Hello and welcome to this video. Comments are very important in programming. They are used to tell you what something does in English and they are also used to disable or deactivate parts of your program for testing purposes or parts that you want to eventually remove from your program. And in Python, there are two ways you can implement comments in your program code. The first is known as a single line comment. If you want to comment out a single line at a time, you use the hash symbol. We also have the multi-line comments. If you want to implement or comment out multiple line of code, you use the three quotes, and that will comment out the block of code you have specified the comments to take out. So let's take a look at how comments work. So I have got some lines of code inside my text editor. I'm using Atom and this is the file here that I'm referring to inside my text editor. So these are just a bunch of print statements that will print these texts onto the console. So I've also got my command prompt open here on the bottom and my command prompt is basically where the code will be outputted. So to be displayed in the console here. So notice here, I've changed directory to my desktop because the desktop is where this file is. This is the file I'm referring to. If you are on a Mac, you need to type in Python 3 followed by the name of your app before you can run it. The reason for that is that the Mac has both Python 2 which is pre-installed and then the Python 3 which you would have installed. So you always have to specify which version of Python you're referring to on the Mac. So let me print out this program here what's inside this file just by calling the file name which is this. So I just say my app.py because it's a Python file and I'll press enter. And you can see here it has displayed the output from here, displaying what's in here. That's the first line and this is the last line here. So let's say I don't want the first line to be displayed. I want to take out the first two line and the way I would do that is just add a comment, just use that. You can see comments out that line completely. And if I want to take out the second line as well I just put a hash and that you can see the coloration has also changed and that takes out those two lines. So let me just save that. And if I run the program again just by moving the up arrow on my keyboard that will run it again. I just press enter. Now you can see it starts from here on line three. That's the text there. It's not displayed line one and two. You can see no line one and two here. It starts from line three which is this one and ends on line six which is that one. So that's how you implement a single line comment. If you want to comment out a single line of code. Also when you comment out a line of code you can also write some text just to if you want to be more descriptive of what it does. Now you can also have comments that will not impact on the code running. So for example line three here let me minimize this screen. In fact let me clear this to create some space. So I'll clear that and I'll minimize that. So let's say on line three here I want to add a comment. So I can add a comment. If you add a comment on the right hand side it does not impact on the code. It will not affect it. You can see it hasn't changed the appearance or the background color. All right so when the idea of putting a comment on the right hand side is that you can then add some text to say what this line does. So I can say this line prints this blah blah blah. So it's just I can then add a descriptive text as to what that line of code does. So that's how you work with single line comments. So I'm just going to take that out. The single line comment and take this one out as well. Now we have the multiple line comment. So let's say you want to, I wanted to comment out multiple lines. So let's say I come here. So you just do one, two, three. It has to be three. And then I come here on the bottom and I do one, two, three. So you can see everything here has turned green. You can see the print here is no longer highlighted as blue because everything here is now commented out. So this is commenting out multiple lines of code at the same time. So let me save this and then try and run it again in my console. So again, I just type in the name of the app, myapp.py and it should only run the first two line of code. And that's because the other lines have been commented out. Okay, so this three, speak this three here quotes and the three here. That's how you do a multiple line comment. And you can also add text to that to describe what you are commenting out. So comments are very useful. If you don't want the code to be affected, you can obviously use single line comments to comment out on the right hand side, what that line of code does. Or you can add multiple line comments and then just write some descriptive text of what that block of code is doing or is meant to do. So comments are very useful because they may come at a time you may want to test setting aspects of your code. You don't want that block of code to run. And the way you do that is to just comment out either that line of code or the entire block of code. And that will prevent that section from executing when the code runs. So that's it for this video on using comments in Python. Thanks for watching and bye for now. Hello and welcome to this video. Indentation in Python is used to separate or section off parts of a block of code. Python, unlike other languages, does not use semicolons or curly braces to indent code. Python uses white spaces to separate code blocks so as to indent the parts of the code. So indentation in Python is very important. Indentation in Python can be created using tabs or spaces. However, it is recommended that you use spaces and not tab to indent. And when you do use spaces for indentation, make sure that they are for spaces. You could be more, but it is recommended to indent using for spaces. It's also advisable not to mix the indentation. So don't indent with spaces and also indent with tabs. That would confuse Python. So I would recommend you stick to using spaces to indent your code. Inside my text editor, I've got a Python file, which is this file here on my desktop. And this is a content of the file. So you can see here the print statements are all on the same line, which is okay. So if I run this block of code inside my terminal on the bottom here, so I just need to do call the application by its name. So I do myapp.py, if you are on a Mac, you need to type in Python three, followed by the name of the Python file before you can run it. Now you can see here the content of the file has been outputted in my console here. Now these lines of code as it is, is properly indented. So indentation, if I wanted to, for example, now if I should indent that, just do that. This, and I tried to run this file again, it will fail because the indentation is out of line, it's not appropriate. So let me go to my terminal and run again. I expect to get an error. You can see here, it tells me, gives me that, say print tells me where the error is, which is this online too. You can see that it says silence is true friend, which is this one. It's telling me that the indentation is not correct. So once the indentation is wrong, it does not run the code. This is very important when you are writing several lines of code to make sure that it is properly indented, okay? Because these are all single line statements. They have to be on the same line. So that's why the indentation is important. If you had several block of code in different sections, you use indentation to separate the sections of the code so that each block belongs to a certain section. With single line comments like this, it's okay because these are just print statement and they all should be on the same lines because they are not part of a block. They are independent. So they have to be on the same line. If you try to shift them like I did in this one, it impacts because it means the indentation is not correct and therefore gives you an error in the application. So that's basically how indentation works. So it's very important in Python. Thanks for watching and bye for now. Hello and welcome to this video. In this video, I'll be talking to you about a very important concept in computer programming called variables. Variables are very important. They allow you to store various pieces of information that you can use for your application. If you look at big, large applications like Facebook, Instagram, Twitter and the host of others, they all use variables to store and retrieve information. Even your bank, when you go to get some money from the bank or from the machine, it all stores information and retrieves information. All that is done using variables. So what is a variable? Variables basically is a holding container that is used to store a value that can be referenced as of when required. The value that the variable stores can vary, that means they can change, hence the name variable. Variables are parts of your computer's memory where information can be stored. The variables are given names in order to identify them. We then use the names to retrieve the information that the variable stores. Variables can hold values of different types. That means they can store number related values. They can also store string or text related values. Before creating variables, it's good to know some common convention when you are naming your variables. Variable names are case sensitive, so you gotta be careful when you give your variable names. For example, if you name a variable H and then try to reference it using capital letter A, it will not respond because they are treated as two different things. So make sure when you're creating variables, you reference them using the exact name and case that you have created them in. Names in variables can be letters, they can be alpha numeric, so they can be letters and contain numbers. They can also contain signs like a dollar sign or the underscore. Variable names cannot start with a number. You can embed a number in your variable name, but you cannot start it with a number. For example, you can call your variable 247 learning. You can start a variable with lowercase word. If you have a variable that has two words, you can start it with the first letter being lowercase and then you can add the additional letters with an underscore. Doing it this way makes it a snake case. So when you have two words separated by an underscore for a variable name is called a snake case. You can also represent it in camel case. Camel case basically means the first word is lowercase and the second word becomes uppercase. They call it camel case because it's got, it looks like the hump of a camel. Also when you name your variables, try to give your variable descriptive names that indicates what type of data or things that the variables actually stores. For example, if you are creating a variable regarding the score that a game stores, you can call it game underscore score. That is a good descriptive name for the type of information that that variable stores. Also when you are creating variables it's very important to know that you cannot use the Python reserve keywords. Reserve keywords, these are words that the actual Python programming language uses for different things so you cannot use them. So this is a table showing you the key words in the Python programming language. These are words that you cannot use as variable names. So that's it for this video on the introduction to variables. Thanks for watching and bye for now. Hello and welcome to this video. In this video we are going to be creating some variables. Creating variables in Python is really straightforward. All you need to do is give the variable a name and then you assign some values for the variable to store. I'm going to be using my command prompt to create some variables. So I'll be accessing the Python interactive shell. So to do that I just type in Python and press enter. If you are on a Mac you need to go to your terminal and type in Python three. So the first thing you need to do when creating a variable is to give the variable a name. So give it a name that is descriptive that reflects what type of data or value that the variable stores. So let's say I create a variable age and you use the equals to assign a value. So I'll say I give it an age of four and press enter and that's the variable created. If I want to access that variable the value inside that variable all I need to do is call the variable by its name and press enter and it will return the value. You can also change the value that the variable holds. For example, I can come here and say age equals to five and press enter. Now if I call that variable age it will no longer store four, it will not store five because the value has changed. So the value that a variable stores can vary. So let's say I create another variable and I give it a value of say blue lime. Now if I want to reference name I just say name and it will give me the text blue lime. If you notice there are quotes around it if you don't want the quotes you can just do print. I can just say print name by wrapping the variable inside the print function it will print out the value without the quotes. So let's create a few more. So I'll create another one called city and I give it the value of say London. I will create another variable. So I'll create one called greeting and inside this I can store a long piece of string or text. So you can always store what you like inside your variable value. So I'll say hello world. And do that. So I'll say hello world and I'll say thank you. So variables are quite useful. So for example, anytime I want to say something like this I don't need to keep typing it out each time. I just call the variable by its name. For example, I can say print and inside the print function I just pass in the name of my variable which is greeting and it will just spit out the value. You can see here is just printed out the value of that variable. So variables are quite useful because you can store a lot inside them and that saves you typing things all over and over again. So if you have values that you want to use or reference often within your application you can store those values inside variables and then just change it as you go along. You can also construct a sentence or statement using variables. For example, I could say print. Inside my print function I could construct a simple sentence. So I could reference, I could say name which is a name of, I've got a variable called name with the value blue line. So I could say name, I do a comma and then the quote, I'll say is from and I'll end that quote and a comma and I'll say city. Now the name and the city are both variables. So I've got a name here with the value blue line. I've got a variable here called city with the value of London. So what I'm saying here is I want this print function to print out the name which is blue line and then add this piece of text and then add this variable name. So if I press enter you can see it's constructed something saying blue line is from London. So you can see the power of variables. You can store any data type, you can store numeric related values and you can store string or text related values. Also variable names can change so you can create a mean variable values can change. You can create a variable and then later on reassign the values that the variable holds. So that's it for creating variables. Thanks for watching. Bye for now. Hello and welcome to this video. The Python number data types are used basically if you want to work with numbers in a Python program. Now there are two main common ones that are normally used with Python. The first is called an integer or int for short and the second is called a floating point number or a float for short. So these are the two different types of number data types that you can work with in a Python program. It is important that you have a grasp of the differences between the two so you can use them appropriately. So I'll start with integers. Integers are basically whole numbers or counting numbers. That means they can also have negative numbers, positive numbers, which includes a zero as long as they don't have decimal places after them. So they are numbers without any decimals and they can be numbers that are unlimited in length. Examples include zero, 100, negative 80, 400, and so on. As long as it is a whole number, it can be positive or negative but must not have decimals. Floating point numbers or a float are basically numbers that have decimal places. So they can be positive and also they can be negative but they must be numbers with decimal places. Examples can include 0.0, 4.5, 38.5, negative, 27.0, and so on. So the key distinction between a floating point, a float and an integer is the decimals. A floating point number has decimals while the integers are whole numbers without decimals. Knowing the distinction between the two will help you when you are working with the number data types in Python. It's important to understand the difference in the data type so that when you want to use them, you get the desired result. So I am going to go into my Python shell by typing in Python in my command prompt on my Windows machine. I'll type in Python and I'll press Enter. If you are using a Mac, you need to type in Python 3 and press Enter on your terminal. So what I wanna do, I just wanna use a simple print statement to print out a number and I'm going to use a built-in method in Python called type to tell us what class of data type it is if it's either a float or an integer. So to do that, I just type in print and I do a parenthesis. Inside the parenthesis, I'm going to use a Python method called type. It's a method, so it has to be enclosed in parenthesis. Inside that parenthesis, I'm going to include a whole number and I'm gonna close that parenthesis and then close the inner parenthesis. So if I press Enter, it should tell me the class of data type if it's an int or if it's a float. So I expect it to tell me it's an int. So I press Enter, you can see here it says class int. So let's do another one that will tell us it's a float. So I do a print and inside there, I do a type. For that type method, I will specify say 20.0 and I'll close that and close the other parenthesis. I press Enter, you can see that the class has given me a value of float. So once you understand the distinction between the two number data types, the float and the int, it will help you decide what to use when you are building various types of application that relates to numbers. So that's it for this video. Thanks for watching, bye for now. Hello and welcome to this video. In this video, I will be talking about the string data type in Python. Anytime you hear programmers and developers talking about string, they are basically referring to text and characters. A string in Python is basically a sequence of character data. For the computer to recognize that you are referring to a string, you have to enclose or surround the text in quotes. The quotes can be single or they can be double quotes, but you cannot mix them. You can't start with a single quote and end with a double quote. All characters between the opening and closing quotes are all part of the string. Also, a string can contain any character you want, including spaces. They can also contain backslash and other kinds of characters you want included in your string. A string can also be empty. So you can have an empty string. Just have the quotes and nothing in between the quotes. A typical example of a string is Hello World. So the text enclosed in quotes is what the computer will recognize as a string. If you don't enclose it in quotes, the computer will not know what you're talking about. I have got my command prompt. If you're on a Mac, you need to open up your terminal and type in Python three. If you're on Windows, just type in Python to access the Python shell and press Enter. I'm just going to use the print statement or function to just print out some text on the screen here. So I'm just gonna type in print and inside the parentheses for the print function, I'm going to just print out a simple text and just say Hello and just close. You can see I've got the opening double quote and the closing double quote and I'll close the parentheses for the print function. Now if I press Enter, naturally just print out Hello World without the quotes. So you can see here it's giving me the text Hello World. So that's how the computer understands that you are talking about a string. So anytime you want to refer to a string in Python, you have to enclose it in the quotes and the quotes have to be matching. You can't start with a double quote here and then end with a single. You either use two single or you use two doubles on either side. So let's do another example. If I say print and in quotes, I just have a single quote and I just say Hey and just close that and press Enter and you can see it just gives me Hey. So you can use either single or double quote. What if you have a character that's got that you want to use an apostrophe? How would you represent that in a string character? So this is how you would do it. So let's say we have the print function and inside that I want to have a string. So I can just say Hey and I'll type in what. So you use what they call a escape character which is a backslash. So I do that and then add the single quote and I want the S and I'll type in up and then I'll close that. By doing it this way, it will output the apostrophe with the what's up. Because I've got, I can't use double quotes because I've already got the double quotes on either side and closing the string. If I press Enter, you can see here it says what's up. It's now using the apostrophe. The only way I was able to achieve that was by using this escape character to escape the sequence and produce this here. Okay, so that's how you use that character. All characters in a string has a specific index that is associated to them to identify their position or location within the string. So what that means is that you can tell what number a particular string is positioned within a string. And with Python, the index are zero based. What that means is that the first letter or the first character will have the index of zero. The next will have the index of one and so on, for example, now this H will have an index of zero. The position will be zero. And then the E, the position of the E would be one. That's what it's referred to as a zero based index. So let's do a quick example to see how the index works in Python. So I can just do a simple print statement and inside the parentheses, I would just say hello. Okay, and then I'll close the parentheses and then to find out the position of a specific character, I need to use the square brackets. Say for example, I want to find out the position of E in hello. It will have an index of one because the first has an index of zero. So I'll close the square brackets and close the parentheses for my print function. And if I press enter, it should return and it should return the value of E, you see? So E here has the index of one because it's a zero based index. So knowing how indexes works is quite useful as well in Python. So that is it for this brief introduction to the string data type in Python. Thanks for watching and bye for now. Hello and welcome to this video. In this video, I'm going to briefly introduce you to the Python data type called a Boolean which is also referred to as a Boole. The Boolean data type basically has two values which are true or false. When you're working with data in Python, there may be times you want to check the validity of certain conditions. You can use the Boolean data type to check if those conditions are true or false. I have got my command prompt. So I'm going to access the Python shell by typing in Python and then pressing Enter. And that should give me the Python shell. If you are on a Mac, you need to type in Python three on your terminal. So what I want to do, I want to use a special method in Python called the type that I can use to check what class a data type is. So to do that, I just type in, I'm not going to enclose this in the print statement. I'm just going to type the method and inside that method, I can just type in true and press Enter and that should return a class which is going to be a Boole. You can see it's giving me a Boole which means it is a data type called a Boolean. So if I do the same, if I type and inside the parentheses, I'll say false and press Enter again, they should give me the Boole. So you can use the type method to check what type of data you have. So that is it for this video. In this video, I briefly introduced you to the Boolean data type in Python. Thanks for watching and bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to what lists are in Python. What is a list? A list is basically what the name says. It's a list. So it's a collection of data which can be of mixed type. What that means is that the content of the list can be a string, which is a text. It can be a number. It can also be a Boolean value. So the data type can be either the same or they can be mixed. The items in a list are ordered by their index and they're also changeable. When I say they're ordered by the index, the index refers to the position of the elements in the list. And also the elements can be changed. So you can have items in the list that you can later change. List are created by using square brackets. So you have the opening left square brackets which opens up the list and then the closing right bracket which closes the list and then you can have items in the list. You can also have an empty list just with square brackets and then nothing inside the list which you can populate at a later time. The items in a list can be accessed by the index. The index refers to the position. So if you have a list that contains five items or values, the very first item will have an index or position of zero. The second item will have an index or position of one and so on. Each item in a list has to be separated by comas. So you separate the values in a list with a comma. A list is very useful. It allows you to store multiple values in one container or object. So that is it for this video. In this video I gave you a quick introduction to what lists are in Python. Thanks for watching. Bye for now. Hello and welcome to this video. In this video we are going to be creating a list. To create a list you just need to give the list a name. You use equals two and then you assign the values in the list. So you, the left square bracket opens up the list. Then you add the values in the list. You separate each value with a comma. If it's a text or a string you need to enclose it in quotes like I have done in the illustration. And then you use the right square bracket to close the list. So let's create a list. So to create a list I'm going to be using the text editor called atom. And I've created a new Python file which is this file here on my desktop and I've called it my list. So you can create a file, a Python file and then just save it anywhere. Your desktop may be easier like I have done. And then this is the file. So this is where I'm going to be creating my list. To create a list you start with a name. Always give your list a descriptive name to reflect the type of elements that the list is storing. So I'm creating a list called animals. And I'm going to set that to the different values. So I can just say the first value in there. I can say a bear. I'll do a comma to separate the values. I'll add another value. I'll say maybe a tiger. I'll do a comma, add another one. Let's say a lion. And so on you can add as many items as you want in a list. I'm going to add, let's say, a panda. Let's add one more, do a comma. And I'll make this one an elephant. So these are now elements in my list. So to save the file I just do control S on the windows. If you're on a Mac you do command S. You can use what is called a for loop if you want to loop through the elements in the list and print them out, you can loop through them. And the way you could do that, you just do a for and you save for X. Let's represent the name of the list as X. So we can save for X in animals. And then you add a colon. And then you use the print function of print statement and passing that value of X. So I just do control S to save. I'm going to open up my command prompt, which is this. And to access this file here, which I've saved, I'll just call it by its name, which is my list.py. And I'll press enter. I can see here is listed all the elements of the list. So I'm just going to clear my console by typing in CLS. If you're on a Mac, you can just type in clear and that will clear the console or terminal. You can also use the print function on its own just to print the list. So I can type in print. And inside the parentheses for the print function I just pass in the name of the list. And what that would do, it would just print exactly as it is. So I'll do control S to save. If I open up my terminal, type in the name, which is my list.py and press enter. When you execute code, the code will execute in the order you've written it. So it's printing out each item first using this block of code. And then it goes onto this block of code and just prints the, which is this block block here. It prints the entire list just the way it was created. So that's basically how to create a list in Python. Thanks for watching and bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to if statements. If statements are basically conditional statements, that means they are statements that only execute based on certain conditions. If statements are important aspects of the control flow of a program, they help you make important decisions in your programs. They only run the code in the if block when the condition is true. So when you write an if statement, you'll have a block of code that you want to execute. If the condition that you have set is met. So only that particular code will execute. If the condition is not met, then nothing runs. That code does not execute. If statements normally can use comparison and logical operators to check if certain conditions have been met or not. This is a basic syntax for writing an if statement. So you have the if keyword and then inside that parenthesis, you just specify the conditions and then you have this colon here. This colon is very important. It tells the Python interpreter that you are starting a new line of code. So when you have this colon here, it indents. If you have a good text editor, it will automatically indent into a new line that enables you write some new line of code. So whatever code you write here in the indented block, that is the code that will run or execute if the condition that you have set in the if block is met. To illustrate how the if statement works, I'm going to create a new file inside my pycharm IDE. So I've already got a directory with some Python files. So I'm just gonna right click on my directory and go new and click on Python file. I'm just gonna call it if and it will save it as a Python file with a .py extension. So I'll click okay. So now I've created a new file. The first thing I wanna do is create a couple of variables. So I'm gonna create a variable. I'm gonna call it A. I'm gonna give it a value of seven. I'm gonna create another variable and I'm gonna call this B and I'm gonna give it a value of eight. So I want to use the if statement to check for setting conditions before I can run what's inside this file. So I'll say if A and then I'm going to use an operator to check. I'm gonna say if A is less than B and I'll add my colon. The colon is very important. When I press enter, you can see it's well indented. Indentation is very important in Python. So if you're using PyCharm, it should automatically indent it for you. So now it's prompting me to enter a new line of code. So I'm just going to say print and inside my print parentheses, I will just say the A variable comma and then I'll enter a text. I'll say is and then I do a comma to exit that string. And then I'll say B. B here is referring to the value of this variable B. So once I've done, I just save my file. Now what this will do, basically I'm using this operator here which is the less than sign to check for a condition. The condition I'm checking for is, is the value of variable A is a less than the variable B. Seven, which is the value of variable A is less than the value of variable B. So the condition is true and then this block of code will execute. Now if the condition is false, nothing happens. The code will not run, it will just do nothing. So let me run this code so that you can see. All right, click and go play. And you can see here is outputted seven which is the value of variable A is smaller than eight. Now if the condition was false, nothing would happen. So if I reverse this, for example, if I change that to a greater than that will make the condition false because A, which is seven is not greater than B which is eight. So now let me try and run this again. You can see nothing runs. You see the code does not execute. This block here does not execute. Okay, so whatever code you have inside the if block this here, what about the print function is known as the if block. So if the condition I set here is wrong or it's false, this code will not run. The code will only run if the condition inside the if block is true or evaluates to true. So if statements are very important in your control flow always remember the indentation and the colon. Any way you see a colon here, you're telling the interpreter that you want to start a new line of code and make sure it is indented. If it's not indented, the code will not run. The interpreter will complain. That's it for this video on if statements. Thanks for watching and bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to another type of conditional statement called ELSE statements. What are ELSE statements? ELSE statements are conditional statements that only execute certain block of code when a condition is false. So it is different from the if statement and the ELSE statement. Those condition checks for conditions that are true. While the ELSE statements would check for conditions that are not true and then execute the block of code that it has. So this is what a basic syntax looks like for an ELSE statement. So you start off with the if statement, which is the first conditional statement to check if a condition is true. You then go on to the ELSE conditional statement. We check if another condition is true. Now, when the condition in the if and the ELSE are not true, it then goes to the ELSE block and execute the code in the X block. So remember that with the if and the ELSE, this block of code will only activate or run if their conditions are true. Now, if those conditions are not true, it then jumps to the code inside this ELSE block and execute the code. If the code in the if and the ELSE fails. I'm going to illustrate how the ELSE statement works. So I'm gonna create some variables. So I'll create a variable A and I'll give it a value of seven. I'll create another variable B and I'll give it a value of eight. I'll create one more, call it C and give it a value of nine. So before you can implement an ELSE block, you must have an if block in place. So I'll start with an if. So I'll say if the variable A is greater than the variable B, I'll add my colon and press Enter and that gives me the indentation. So now I'll write the body of the code that will execute if the condition is true. So I'm gonna reference the variable A. So I'm gonna say A comma and then I'll add a string and that string is basically going to say if A is true, that condition detects will say A is smaller than I'll add a comma to escape that string. I'll say B. So now this condition here is my first condition. Don't forget the condition in the if block will always test for a true condition. Next I'm going to add an ELF block. So I'm saying ELF if the variable B is greater than or equals to the variable C. I'll add my colon, our tab. The tab gives me indentation. Anytime you have a colon, you're telling Python that you're writing a new line of code to be indented against the block of code. So you know that each block of code belongs to a particular condition. So now I'm going to add a print statement. So I'll say print and I'm just going to add something that will print. I'll say B, which is the value of the variable B and inside that I will add a string. I'll say B is smaller than and then I'll escape that string to a comma and add the variable C. So this condition in my if block and in my else if block both have to evaluate to true for the code to execute. So this code here on line six is the if block code that will run if the condition set in line five is true. The code block on line nine is what will execute if the condition set on line eight is true. So if those both conditions are not true, this is where the else statement comes in. Then we want the code inside the else block to execute. So you add the colon and I'll just tab and I'll just do a simple print statement. Inside that print statement, I will say C which is the variable C and I'll add a text that will say is larger than I'm going to escape that string with a comma larger than B and I'll do a comma, add another string, add and I'll do a comma to escape that string and then I'll add an A. So that is my code completes. When the code executes, it will check for all this condition. This first condition here is going to evaluate to be false because A which is seven is not greater than B which is eight. So this block will not execute. So this block here is also false. B is not greater than or equals to C because B is eight and C is nine. So this block of code again will not run because the condition is false. We then jump onto this block of code which is the else block. This block of code will execute. There is no condition set. I've just said if these two conditions are not met, I just want this code to run. The code on line 12 is what will execute. So let me play that so that you can see the result. So if I press the play button, you can see here is printing out this code on line 12 which says nine is larger than eight and seven. The C is the nine, the B is eight and the A is the seven. So you can see only that code executed because the other conditions have not been met. So you only have one block of code execute. Anyone that matches the condition that block executes. If for example, this condition was true, the code will stop here. The other two, this two block will not run at all. If this block was true, it will stop here and this block here will not run. So the else statement is an alternative statement that will run when the conditions you're testing for is false. So that's it for this video. Thank you for watching. Bye for now. Hello and welcome to this video. In this video, I'm going to introduce you to four loops. What is a for loop? A for loop is a type of loop that is used to iterate over a sequence. So it will go through a sequence of items or values. The sequence is usually things like a list, a tuple, a dictionary, a set or a string. So it has to be a collection that the for loop can loop or iterate through. The loop does not require an indexing variable in order to get initiated, just like with a while loop. With a while loop, you need to have an initial indexing variable for it to work with. You don't need that with a for loop. Also a for loop can use a break and a continue statement. So you can use those statements with a for loop. So let me show you how a for loop works. I'm going to create a variable which is going to be a list. A list is basically a collection of items or values. So I'm going to create a variable. I'm going to call it fruits. And I'm going to set that to equals to a list. And inside that list, I'm going to add some items. First item is going to be grapes. I'm going to add a couple more. Next I'm going to add berries. And I'll do one more. And finally, I'm going to add oranges. So I have now created my list. So now I need to use a for loop to loop through the items in the list and print them out in my console. So to do that, you need the four keyword type in four and I'm going to just use a random letter. So I'm going to say X. So X basically is going to represent each item or each value in the list. I'm going to say for X in the variable called fruits. I'm going to add my colon and tab. And I'm going to tell it to print X. And what that's going to do is going to print each item in my list on the screen. So let me press the play button. So you can see the output, I'll click play. And you can see here in the list, you can see it has printed the items. I've got grapes, I've got berries, I've got oranges. So you've got grapes, berries and oranges. So that's what a for loop does. It iterates over a collection of item or a list and then it does what you tell it to do. Online for here, I've told it to print the item. So X here represents each of the items in the list. So that's how for loop works. Thanks for watching and bye for now. Hello and welcome to this video. Functions are an important part of programming in Python. They help us keep our programs organized and makes it possible for us to reuse the code we write. There is a principle in software development which all good programmers try to follow. It is called dry principle D-R-Y which stands for don't repeat yourself. In other words, it means don't write the same code twice. Now functions can help you avoid writing the same code twice. So what are functions? Functions are basically a collection of computer code which can be executed anywhere in your program and also use over and over again so they are reusable. And these block of codes always do something specific. The beauty about functions is that they are reusable. They execute or run when they are called and you usually call them by their name. So when you create a function, in order to activate it, you need to run it or call it by the name you have given it. They can have parameters. Parameters are basically variables that you define inside the function parentheses and also they can have arguments. Arguments are the actual value that you give to the function when you call the function. They can return data as a result. So if you want the functions to return data, they can also do that. Functions are built in and they can also be custom created. Example of the built in functions we have used. So far is print. The print is a function which allows you to print stuff on the console. You can also create your own custom functions which are called user defined functions. Creating a function is fairly straightforward. Before you create a function, it's good to think of a descriptive name that you want your function to have. The naming convention for a function is the same as the naming convention for variables. To create a function, you start with the DF keyword which indicates you're about to create a function and then you give the function a name followed by parentheses and then the colon. The colon basically tells the Python interpreter that you're about to start a new line of code. So whatever code you write here is the block of code that gets executed when the function is activated. When you define functions inside the parentheses, the parentheses can be empty or you can pass in what is known as parameters. Parameters are basically variables that you define inside the function. When you activate your function, you can also give it a value that matches the parameter you set. That value is referred to as an argument. So I've already got a directory. I'm just gonna right click on the directory, click on new and click on Python file. I'm gonna call it functions and it will automatically append it with a .py file extension. So I'll click okay and that was created the file called functions.py. Create a function. You start with the keyword DEF. You do a space and then you give the function a name. I'm gonna call my function sum and then you add the parentheses. Inside the parentheses you can add parameters or you can leave the parentheses empty. So I'm gonna add a couple of parameters which are variables. I'm gonna call this x and do a comma and I'll call this y. And once you're done, you add a colon. The colon basically tells Python that you want to start a new line of code. So here now is what is called the function body. This is the code that will execute when the function is activated. So I'm just going to say x plus y. So that is it. We have created a function. Now the x and y are known as parameters, okay? So when this function activates, it will print the value of x plus the value of y. Once you have created your function, the function does nothing until the function is activated. Now the process of activating the function is called calling the function. It also has other names. You can call it executing the function or invoking the function. So any phrase you hear relating to call, running, executing, invoking, they all mean the same thing. And when you call a function, you call it by its name and you add the parenthesis. Now if you have defined some parameters during the function definition, then you need to pass in some arguments when you call the function. Those arguments are the values that you give for the parameters you have set in the function definition. So to activate or call this function that we've created, we need to call it by its name and the name is sum. So we'll say sum and then we add the parenthesis. Now notice that we had two parameters defined inside the function. We've got x and y. So now we need to supply the values for x and y. Those values are known as arguments. So if I say four comma five and that basically calls the function passing those two values for the parameters I have set and then it will execute the function. So let me save that and then play the file. So I click on play and you can see here is returned a value of nine. Okay, so is added because here I've said print x plus y. So when I call the function, I'll pass in two values, four for x and five for y and it returned the value of nine. So that's how you call a function once you have defined the function. It is good to know the difference between parameter and argument. Sometimes this can confuse beginners. A parameter is actually like a variable that you define inside the function's parenthesis while an argument is the actual value that you pass or give to the function when you call the function. So in our function x and y are the parameters while the number four and five are the actual arguments for those parameters. So that's it for this video. Thanks for watching. Bye for now.