YTread Logo
YTread Logo

Python Tutorial for Beginners - Full Course in 3 Hours

May 31, 2021
What's going on guys, Assalamu Alaikum? Welcome to Code friends. My name is Nelson and in this

course

you will learn how to code. This

course

would not be possible without the collaboration of Intrigue Quickbooks. We decided to package this course to provide you. everything you need to start your career in technology. We know that during this pandemic things have been very difficult, but we want to give you the knowledge you need to explore technology and programming in this course. I will make sure that you understand what programming is what you can do with programming and then we will learn about Python, so Python is an easy to learn programming language suitable for

beginners

and by the end of this course you will understand exactly how to work with Python.
python tutorial for beginners   full course in 3 hours
We will learn how to write code, run code, learn about basic concepts like classes, loops, variable functions and much more, but the most important thing is that we wanted to give you everything you need to give you the right boost, so towards the end we are going to Build together an app that can ask you a series of questions, whether it's text or voice, and then it will generate a resume for you, then we'll take that resume and create a portfolio together and this can be your starting point. Literally, this can be your starting point and you will see that programming is not that difficult.
python tutorial for beginners   full course in 3 hours

More Interesting Facts About,

python tutorial for beginners full course in 3 hours...

Many people think that programming is only for people who know a lot of math or very smart people, but don't worry, I'm going to simplify things. so that you

full

y understand this amazing programming language, if you are new to my channel, go ahead and subscribe, it means a lot to me, also join the private Facebook group and Discord because the community is growing, there are more than 10,000 people learning how to do it . to code and you should be a part of it without further ado, let's start this course, join me just before I start this course, I just want to tell you that as you continue, I want you to practice literally, just follow each example. ready, get your laptop ready and let's practice, practice, practice, that's the only way you will benefit from this course and I really want to add value, but you need to practice while I teach.
python tutorial for beginners   full course in 3 hours
Also join Facebook and Discord because the community is there. To help you, I don't want you to feel alone on this journey into discord. I've created a dedicated channel for people who sign up for this course that way. If you have questions, we will be there to answer every question you have. you have done it but also if you live in the UK we will send you gifts this is all I wanted to say without further ado let's start this course for this course you will learn about Python. Python is a programming language, so programming language is a language that a computer can understand in the same way that we have different languages, that is, Spanish, English, French, Portuguese, etc., it is the same way when we talk to computers, so we have Python as one of many programs.
python tutorial for beginners   full course in 3 hours
Languages ​​Python is really suitable for

beginners

because it is easy to learn and in this course I want to make sure that you

full

y understand this language. With Python you can do a lot of things well, you can create websites, you can create games, you can create desktop applications, web applications. if you like machine learning, if you like data science, Python is the tool for you, but don't worry too much about these things because first let's understand how to use this language and then you can decide which way you want to go. Now that you know what Python is, let's go ahead and install Python on our local machine, so I'll use my computer, but this setup that we're going to do will work for both Windows users, so let's go. go ahead and navigate to google.com and here and type

python

so go ahead and just type

python

and you can see we have this page where it says welcome to python so this first page is python.org and on this page on the right here you can see we have the downloads link so go ahead and click on downloads and right here since I'm on a Mac I can see the download link for Mac OS but if you're on Windows just click on Windows or Linux. you can just use the specific version for your OS which is great, also here you can see these are the active versions, so the active version right now, the latest one is 3.8 here and if I show it to you, 2.7 ha reached the end. of life, so you really shouldn't use this version here and if I scroll down you can see that we can have, you know, specific release versions, but usually you just go ahead and download the latest version that has support until 2024. right here you can see that the latest version as I speak is 3.8.5.
You can watch this video later and if you haven't, if there is a new version, everything that I'm going to teach you in this course will work with the version that you will install, so let me go ahead and just download Python, there we go, let's finish now let me open up the downloads folder and here you can see I have Python so let me just click on it and let me just collapse this so the installation process for both Windows and Mac OS is really easy you just have to press Continue and then accept and then install so before you press or enter my password if you're on Windows make sure you check the box that says add python to the correct path so that's really important so you can use python from your terminal , so on Mac it does it for me, so here let me put in my installation password, I just give you a second and that's it.
After successfully installing Python, let's go ahead and install a program that will allow us to write Python code Now that we have Python installed on our machines, we need a way to write Python code so that we can write the Python code that we need. use a text editor in the same way as if you write English or want to write some documents you use for example Microsoft Word well when it comes to programming we have specific text editors that allow us to write code in any programming language and the text editor What we are going to install to write Python code will be vs code, so vs code is an amazing text editor created by Microsoft and is widely used in the industry.
Let's go ahead and install it if you navigate to google.com and then type vs code so this first link where it says Visual Studio code here so let's click on it so in this course we're going to write Python code so we can use vs code to write Python code, but we can also use vs code. write any code in other different programming languages ​​so this tool is actually made by Microsoft and it is very popular so you know let's go ahead and download just click download and then here you can see we have different systems operational. so if you're on Windows click Windows if you're on Linux click Linux if you're on Mac click Mac so the installation process is very easy so here because I'm on a Mac , I'm going to download for Mac, just hit it. one second I'm going to allow it to download and there we go and there we have it so I have this Visual Studio code application right here so this is the actual application itself and if you don't see this on your desktop it's because which has a different destination when you download apps or files successfully, it is most likely inside the downloads folder.
Now what we're going to do is take this application and then place it inside the applications folder and only do this step if you're on a Mac computer. Now let's collapse this and then let me open finder, there we go and I was saying if you don't see this file inside the desktop, it is most likely inside the downloads folder. now let's open the apps, this is where we have the list of all the apps and all we have to do is just put them here and away we go. It's as simple as this. Now we can click on it.
You can see that we have vs. The code is installed fine, so what we are going to do is create our first Python project together, so what we are going to do first is create a folder on our desktop, so right click and then new folder and then name this as learning and then type python, so this is the name of the folder. Now what we are going to do is inside the vs code. You can see we have this section where it says Home. You can view a new file, open a folder, add a workspace folder, so click Open. folder and then navigate to the desktop and then select the folder that you just created and there we go, now you can see that this is the name of the project that learns Dash Python, so it's just the actual folder that we have specified, so here can We can see that we have this welcome tab, we can close it because we don't need it and what we are going to do here first is install a plugin for Python, so vs code allows us to install many plugins to work with different languages, so yes you want to work, for example, with Python, there is a plugin for Python, if you want to work with JavaScript, there is a plugin for JavaScript and for us we need a plugin that gives us many functions when working. with Python and you'll see this in a second so here you can see we have these little squares and here we can search for a bunch of extensions so you can see that the popular tab here we have Python at the beginning so If you don't see Python just search Python and then select the first one.
If I select that one, you can see that it has 26 million downloads, so that's pretty impressive. On this page, you can scroll down and see what. it's all about this plugin but you will learn very soon what it has to offer so let's install this plugin so click install and that's it you can see it says this extension is enabled globally so you can go to the section quick start here. see it says install the plugin and then step three open or create a python file and start coding so let's do that and we'll exit this extensions tab so click on explorer here and inside learning so you can see.
We have a couple of sections here, but here we learn Dash Python, so expand that and then you can see we have this button where we can create a new file, so click on the button and let's name this file my and then underline and then app and then say dot and then py so this is very interesting uh when you say dot py something is happening here so if I remove dot py you can see here we have these lines right and as soon as I say dot py look at this, we have the Python logo, so what this says is that we have a file that has the Python extension, so if you want to work with Python, every file you create needs to have the dot py, so I do it himself, for example.
If you want to work with a different programming language, let's say javascript, just type j and then s and you can see we have the javascript logo. If I want to work with java, I can type dot and then java, you can see the logo changes. right and basically you have different extensions, the same thing, for example, if you've worked with Microsoft Word, for example, this is the file extension um, so dot and then dock and you can see we have the Microsoft logo right there , because we're working with Python, we need to say dot and then py, every file that we create needs to have the py here, so this is where we're going to have our Python code, so press Enter and what I'm going to do here is put this. full screen by clicking on this green button like this and then I'll press command and then more so I want to zoom in so you can see everything we're doing so here you can see what vs code is telling us. that linter pylint is not installed so these are just additional extensions so just install them and wait a second and basically if you see anything else that needs to be installed for newly installed python there are extensions so let me close this and then close this. file here and now look at this, so if I close the extension tab as well, here now this is our file, so if I close this again, I want to show it to you, here we have my underscore app app.py, click on it and You can see this is our Python file, so here we can start writing some code and that's what we're going to do next, let's write our first Python program, so what we're going to do here is the following, inside of This is my script under app.py.
You can see we have this line number here, so if I click on this file, you can see we have the cursor, so this is where we can start typing some Python commands to create whatever program we want. So here, if I press enter, you can see that we're getting these line numbers here and they represent the number of lines of codes that you currently have, so we currently have zero lines, oh actually, we have one line that's empty, but create a python program that prints to the console hello world, so what I'll do is if I make this bigger first because I think it's better ifyou see it correctly and here I'm going to hide this panel right here so click on the explorer and it will hide if you need it again just click on it and you can see it brings it back so let's hide it for now and here we go to write our Python program, so let's write together and print. and then open the parenthesis and then add single quotes, so if you press single quotes, you'll get two quotes, but if you have one, just add another one and then end the parenthesis like this, so here what we're going to do is say hello and then world so this is a very common program for beginners so hello world and now to run this program let's click on this play button to run the python file in the terminal so if I click him, you can see that it has some text but if you look closely we have helloworld and this is our first Python program, so let's close this and change it a little bit, so before we print to the console let's type together name and then space equals and then type input and then inside this input let's add single quotes. and then what is your name and then add a space at the end.
Now this is a variable and I'm going to explain variables in a second, but now it will contain everything that we enter from the console and what we want to do. that is say hello and then instead of world, we want to remove the word world and then have a space here and then a space after this quote and then more and then name like this and we're basically saying we want to print hello plus whatever. We move on to the console so let's run the program and now if you look closely here we have what's your name and we basically just have to type anything in here so for my name I'm going to say nelson and I'm going to make sure that instead of nelson you have your name so here I'm going to press enter and take a look we have hello and then nelson so if I run it again and then let's say the name here is maria and then I go in and you can see we have Hello and then Maria, if I close this and there you have it, you have successfully created your first Python program.
Let's go ahead and learn about a very important concept that you need to know and that is variables, the way I like to explain variables. is using the box analogy, so in programming you can think of a variable as a box, so imagine this is a box and now inside this box you can literally store anything you want, for example you can store the number four inside this box. Right now this box has the value of number four and we have to give it a name for example we could have named this box correctly so the name would be for example number correct so when we say number we get the value which is inside the box on the right so you can store numbers, but you can also store letters, the correct sequence of characters and you'll see this in a second, so for example, let's say this is a sequence of characters, so k, for example, let me take, for example. b from here on the right you put it inside and you can add more letters on the right, but you'll see in a second how this all works, now here, this box has a correct character sequence and I also have to give it a name.
So let's say, for example, this contains a right name of a person, so here I could just say that the name of this box is Jamila, for example, right, because it has the value inside Jamila right, so if I take this , you might as well, wow! You could also store an emoji, and by the way, give me a thumbs up if you're enjoying this video, but you could also store an emoji, and you could literally store anything. I can carry my phone. Put it in here. Does not fit. but you know this variable now contains my phone and you'll see how to represent things in the real world later with Python using classes, so here we go, a variable is simply a box that you can store literally anything inside. and as you saw in our example where we have name equal to the right input, so the name was the name of the right box and then the input was what the user typed in the console it was stored inside the box and then when we print the name, it just took the content inside and then gave it to us, that's why you saw in the console the name output, but you'll see a lot of examples throughout this course, but I think this is the easiest way to do it. to learn what variables are in programming, let me go ahead and show you exactly how to use them, so let's go ahead and remove the previous example here and creating a variable in Python is very simple, so here we have to give it a name, so any variable that we want to specify must have a name, for example here I can say name and then equals and here I am going to write single quotes on both sides and this variable will have the value of jamila, so this variable has the value of jamila now think again about a variable like a box, so a box that has one and only one thing inside and in our case the box has the content of jamila and we have named the box as name, we can also create a different variable here, Let's say age, so this variable h here is equal to two and now we can say 18.
So let's say Jamilah is 18 years old. And we have a second box called age which has the value of 18. So remember that. I said with variables we can store anything we want so in this case you can see we are storing a number so 18 this is a number and here name stores a sequence of characters and in programming it is called a sequence of characters . a string, a string, so let me write you this, so a string like this, so this is what we represent as a sequence of characters, so this is jamila and then 18 instead of number we say it is an integer and in fact, if I put my mouse there, you can see that 18 and then column and then int int means integers and integers are integers.
Now let's create another variable, so here I'm going to say that pi equals two and then three point one and then four. and now this number here is different than this one, so this is an integer and this is a decimal number here and if I hover my mouse there, you can see that now it says column 3.14 and then it floats to the right, so these are decimals. and these are correct, so you see we had strings, we have integers, we have floats, so these are data types, so they are called data types and I said if you have a variable, if I say a variable and then it is same inside any given variable you can store anything you want and that inside your variable has a data type so you will learn more about data types but I just want to show you the basics of creating variables so let me show you other types of data.
So for example if I say cars equals 2 and this time I add square brackets open the square brackets and then close the square brackets on the right and then here let's add single quotes and then let's write bmw so this is a car comma and then single quotes and then here. let's say mercedes and finally we have one more car and then this is going to be a wrench and then a mobile on the right so you can see now this variable here, so the cars are okay, so if I put the cursor on the cars, the type of data is now a list. and we are going to cover more about lists but basically lists allow you to store more than one value and here we have bmw mercedes range rover and you can have as many values ​​inside so again each variable has a data type so if I put my Pass mouse over the name variable here you can see this name is str and sdr means string h this is int pi this is float so floats are decimal numbers and in cars this is a list like this is how you create variables with python and obviously we can print them in the console, so type print and then name and then age, we can also print pi and finally let's print cars like this and if we run the program, you can see that we have jamila 18 3.14 and then the list of cars, we are going to learn how to work with strings, so strings are very important in programming and you will end up using them quite a bit, so here we have a variable name equal to jamila and let's have a second variable that says last name equal to y then smith here so jamila smith and what we want to do is have a second variable so full so we're going to name it full and then we're going to underline name equals two and we're going to give this a name and what we want to do. is to take both the first name and the last name and then store them inside the full name, so for this we can use the plus sign, so first name and then plus and then lord name and actually this should be the first name, like this first the underscore and then the name and here first. and score and then first name, so this refers to this variable, last name refers to last name, so now let's print to the console and then in parentheses, we want to say full and then first name, so if I run this program , you can see we have jamila and then smith, now we need to have a space here, so let's do that, close this and here we're going to say more and then we're going to add single quotes, space and then more and then space and then last name, so yeah I run it, you can Look, we have jamila and then space and then smith, so if I close this now let me show you that with strings we can do many things, so let's say you want to know the number of characters that name has, so type. print, so we want to print to the console how many characters this name has, so jamila, type l e n for len and then here add parentheses and then inside pass first and then the name, we can also print and then parentheses and then len parentheses . and then the last name, so if I save this and then run it, you can see that jamila has six characters and smith has five characters, so if I close this again, another thing I want to show you is what strings let's say that here. jamila on the right, so jamila has lowercase j, so if I save this and then run it, you can see we have lowercase jamila and then uppercase smith on the right, but we want to have a uppercase here, so uppercase j, the way what we do is here, so with this variable here we can say period and now we have a list of methods that we can use with strings and again I will cover the methods later, but here you can see that, for example, we have a bunch of methods. bottom is numeric is top join title split bottom and so on, so let's use this method called capitalize and then end this word with a set of parentheses like this, if I save this and then run it, you can see that now jamila has a capital j, so just to give you one more example, let's say print here and let's say complete and then name dot and we have a list of methods here, so let's say it ends with, so we want to check if it ends with and then this string right here, so Let's say it ends with hello, so run this and you can see that we have a false right, so if I close jamila smith so that the full name doesn't end with hello, it ends with smith and you.
I can see we have true, so we haven't covered this value here, so true or false, but don't worry, I'll explain exactly what they mean in a second, that's how you work with strings, obviously there are a lot of them. There are more things you can do with strings, but this is just a quick introduction to how to work with strings with Python. Alright, let's learn how to work with numbers in Python. We can use any of the arithmetic operators you're used to, so division plus minus. multiplication like that and then we have one that you might not be used to, but this one is modular, so this is the modulo, so you can add numbers, you can subtract, you can divide numbers and multiply and use the mod or modulus function and i'm going to show you this right now, so let's say you want to add two numbers, so let's say you have a variable and we'll call it sum is two and then you want to add 10 and then more and then five right, so we know that 10 plus 5 is 15.
So here I can say print then edit and I have a typo so this should be a sum and here also the sum and then run the program you can see we have 15 here so actually I was right so we can also subtract numbers , so let's say subtract or subtract is equal to 2, 10 minus and then 5, let's also do a multiplication example, so the multiple application is equal to 10 and then multiply and then five, so the times are just a star symbol on the right and then five and let's do a division as well so that the division is equal to 10 divided by 10 and then divided so this is a symbol and then by five now let me print them to the console so we just had a space there , print and then subtraction, multiplication and finally print and then division, so if I save this, run the program, you can see that we have ten plus five is fifteen, ten minus five is five, ten times five is fifty and 10 divided by 5 is 2.0, so here we get a decimal number and that's how you work with numbers andthey perform arithmetic operations on them so the last one I want to show you is modulo so mod I'm going to call it mod and here it's equal to and then let's say 10 and then mod and then 5.
So this one's interesting so print I'm going to say print here and then we want to print the mod so if I save the run you can see we have zero so let me explain this so what is it? what it says is how many times five goes into ten, so five goes into ten twice and what is the remainder, so mod is just the remainder, so five goes into ten twice and the remainder is zero, therefore the result was zero if we say for example three, so we have three here, so how many times does three fit into ten?
Well, the answer is three and then we have one number left and that number is the remainder, so if I save this, run it and you can see that we have one. I'll give you another example, so if we have four, for example, the four on the right goes into ten twice and then we have two as a remainder, so four plus four is eight and then if we add two, we get ten, so what two is the remainder and You can see we have 2 here, so there you have it. This is how you work with numbers and perform arithmetic operations with them.
Sometimes you need to know if an expression is true or false and this is where the boolean data type comes in. So you saw that before, you saw this value true and you also saw false, so you saw these two values ​​here, true or false, so these two values ​​are used when you want to know if something is true or false, so just to give an example. Let's say we want to print to the console, we want to say if 10 is less than 10, for example, right, and remember math, so this is the minus sign, so the way I remember these signs is this one here which has the form of the. and it basically means less, so we want to know if 10 is less than 10, so this is going to give us false here.
Let's see that the result is false, so we can also use 10 is less than or equal to 10. So this is actually true. You can see this is true, here let's have a couple more examples, so let's print and then say that zero is equal so we can say two equals to check if two values ​​are equal, so zero is equal to zero, let's say let's print and then 18 greater than 5 and we can also say print and remember our example we had jamila and then if I say period and remember the method that we used ends with, let's check if jamila ends with and then have single quotes here and then s yes, like this that if I take this line then I'm just going to command the c v command, so copy, paste and change it to a.
If I run this, you can see that we have true, true, false and then true, so these are the expressions, so 10 is less than or equal to 10. is true zero is equal to zero and let's change this to uh one, so correct example, so zero equals one, this will give us false eighteen is greater than five jamila does not end with s correct, so this gives us false and then we have jamila ends with a, of course, it ends with a right here, well, actually the name jamila ends with a so if I save this and then run it again we have false here so this false here is 4 0 equals 1 which is false so there you have it that's right like you have expressions, so these are expressions that return true or false, so these values, for example, if I say is and then I underline adult, then I can store the true value there and then is thin age equals and then false, so I can store the values ​​true or false here, so I can also print them and they will actually be true and the value false, but these expressions give us this data type right here, which is boolean, so a boolean is a value. that represents true or false next, let me go ahead and show you why we have this type of boolean data.
The reason we have this type of boolean data, so true or false, is because they allow us to make decisions when writing code, so let me move on. and let's remove all of this here and say we want adult to equal true, so with Python we have something called an if statement and the if statement gives us the ability to control the flow of our program, so here's how we use the statement if, so if statements work with boolean expressions, so here I'm going to say if and then it's underscore and then adult, so I'm just going to say if underscore adult and then add a semicolon here add a semicolon and then press Enter, so if it's adult, I want to print to the console, it's an adult, right, I want to print to the console, it's adult, so if I run this program, you can see that we have and then add also, this actually is printing. adult, if I close this and then change it to false, I want to see that if I run the program we don't print anything to the console, so let me go back and explain this, so here we are saying if and then this variable is adult, so if the value of is adult is equal to true, we're going to run this snippet right here, otherwise if it's false, we're not going to, we're not even going to run this snippet right here, this is what it says, so if you change this to true, this will actually be if and then is adult, so if it's true we'll print line four, otherwise we won't print anything right, which is why we have these boolean expressions, just to give you another example, so here instead of saying it's adult what I'm going to do is have a variable here I want to say h is equal to 2 and then 18 right now then it's adult let's have another if statement so I'm going to say if and then age and then greater than or equal to 18 add column and then enter, we're going to say print and then inside you can say adult and I'll show you another keyword, otherwise and then column and then print and then add these single quotes no and adult and if I run the program, you can see that we have adult rights because this expression evaluated to true, so if this is true, it will be printed and skipped, but if this expression is false, this line will not be executed, but Otherwise, if I change this to, for example, 17 run, you can see that we don't have an adult, that's how you work with if statements and booleans, so one thing to note here is that it's very important that you indent, so here you can see that I'm pressing the tab to indent this piece of code, so anything that comes after this, if the statement has to be at the same level, it must be indented, that is, at the same level as print, so if I do this This won't work, so if I save this and then run the program, you can see we have an error and it says indentation error.
An indented block was expected, so you can see that it's even red now, so if I indent this, I just hit. tab and then save and now the error is gone so same thing here so if I do this this is invalid so we need to indent this this is how to work with if statements and booleans right now let me teach you about This type of data that you've seen before is called lists, so earlier in this course you saw that we had this variable called cars equals and then we had square brackets, so this is a list that you can store more than one value in, so the difference here between, for example, if I say car equals and then b m w right, then the difference between this variable and this variable is that the data type for cars is a list, so if I put my cursor there you can see that it is a list and what this means is that we can store more than one value, whereas in this variable, which is a string, I can only store BMW, right, I can only store a sequence of characters, so let me remove this, so here let's say we have three cars so let's say we have a bmw and then here let's say a comma to the right so after single quotes comma and then let's say now we have a tesla and a comma and finally let's say we have a mercedes here on the right, so this cars variable is a list that has three elements, so if I say print and then len I can say len for length and then I'll pass the cars in and then I'll run, you can see we have three elements, like this that with lists let's say you want to access this first item here, so BMW, the way you do it is this, so I'm going to say print and then auto, so if I actually save this and then run it, You can see that this gives us a list of what we want. is to take just the first element, the first containing element, so let's say print below and then we're going to say cars and then we're going to add these square brackets and then the way you access this first element is by using an index, so that with lists the index starts from zero, so this is position zero, position one, position two, right, not position one, position two and position three, when we work with computers, the system numbering always starts with zero, so here we mean zero, then cars and then zero, then. let's take this line, duplicate it twice and then here it will be one, actually one and then two and then let's execute.
You can see we have three items, this was the list itself and then position zero, this was BMW position 1, Tesla position 2 and then mercedes if for example you want to access, if I say print or not even print , I can say cars and then let's try to access position three correctly so we know we don't have a position three, so zero one and then two. Okay, so we don't have a position 3. So if I save this and then run it, you can see that we have an error and the error says that the index of the list is out of range, so if I were to add a second or actually another car, then if I, for example, say toyota like this and here now we can say print there we go and there you have it you can see that we have no more errors and we are accessing index number three that contains the value of toyota so This is an introduction to the lists in Python.
If you have any questions, please let me know; Otherwise, let's move on. Now is the perfect time for us to learn about loops in Python. You already saw it if we want to access any element in this list. Here, then, autos, we need to say autos and then the index, so autos indexes 0, index 1, index 2, index 3, if we have another auto, we need to say print and then autos indexes 4, but we can do something much better than this , we can use. loops, so loops allow us to write code that will automatically loop through the list, allowing us to execute any piece of code we want, so let me remove all of this and the way we can use loops is as follows, we can say 4 and then auto inside and then cars so add semicolon here and print so inside say print and then auto so you can see that now instead of saying auto and then index zero index one index two index three we just say four so this is the uh for loop construction so we say four and then this here is a variable that will point to each individual element in this list and then I say in and then cars so loop in cars basically this is what it says okay, so if I save By running the code, you can see that we now have BMW, Tesla, Mercedes and then Toyota, so if I had another car, this time Honda and then save this, run it, you can see that it now automatically cycles through each element of the list.
Let's do something with this car right here, so let's say period and then capitalize and then save, run it. You can see we have BMW, in fact, let's say that here, let's say if we're going to say if and then the car is the same. For BMW we want to do something, so here we want to say a print and then the point of the car at the top, so we want to write completely in capital letters instead of just having the first letter in capital letters and then I'm going to say more, than Otherwise we want to just capitalize to the right, so here we need to indent this because this print statement belongs to something else, so here we just indent like this and now we're saying loop through cars, if car equals bmw, we want to put everything in capitalize otherwise we just want to capitalize and capitalize just takes the first character and then capitalizes it if I save this and then run check this out we have bmw all caps, tesla, mercedes, toyota and honda all with the first character in uppercase, so there you have it, that's how you work with loops in Python, so loops just allow you to loop through any list and then you can run any piece of code while looping through the list.
If you have any questions about working with lists, please let me know; otherwise, let's move on in Python, we have another one. form of loop and is to use the while loop, so the while construct allows us to loop while a boolean expression is true, as soon as it is false the loop ends, so to demonstrate this let's say we have a variable, like this let's say the number is equal to 2. and then 0. then we want to print the number in the console whenever the number is less than or equal to 10. to do that we can say while then this is the construction then while and then we can say that the number is less than or equal to 10 and then finish this with a column and then go in and make sure it's indented correctly, sostring like this, so str like this and then end the parenthesis here and if I run this now you can see. which we have john and then 22 merriam and then 18. so you have successfully learned how to create a class then the class is the blueprint and then from the blueprint we can create various things so here what we have created is john and This in programming is known as an object, so we have two objects, we have John and Mariam, so the class is the plane and then these, so line six is ​​an object and line seven is another object, so here we only define two properties.
Next, let me go ahead and show you how to define behaviors with classes. Remember earlier I mentioned that classes are made up of two things, they are made of properties that we have right, so name age, those are two properties and also behaviors, so behaviors are the things that a particular class can do well, on the other hand, properties are simply attributes like name, age, date of birth, ethnicity, etc., so let's create two behaviors for this class here and then I'll show you how. to use them then let's create a function so that a behavior is just a function so let's say death and then we need to name it so here let's say walk and then have a set of parentheses and then pass self so that self allows us to access the properties What we have are name and age, so here add parentheses and inside this function let's write print and then parentheses and here let's say self point and then name else and then space walks and then let's add like three points, for example, let's also have another behavior so here death and then speak and then pause again and then print and inside let's say hello my name is nn plus and then self dot and then name and then plus say and I am and then plus self dot age and then more years and then age and this function just says hello my name is any name and I am and then actual age and then years and you'll see this in a second so now we have two behaviors for our class so This means we can now move on go ahead and right after we print the name here we can say "let's do it for John first" so now we can say "John Dot" and then let's check this.
We talk and we walk, so talk and remember this is it. a function and the way we invoke functions is by adding the set of parentheses like this and then john dot and then walk and let's do the same with mariam then mariam dot and then and then talk and then call the function and finally miriam dot and then work and then invoke the function again and now we are ready to go, so if I run this and once again I forgot to add the string conversion to an integer, then okay, and here remember that we have to say str and then the actual h in there let's go like this and now let's run it and check this so here we have john and then 22 and then john talks so hi my name is john and me and then we're missing a space here so I'm 22 and then john walks so john is walking and then we have mariam so mariam18 and these here are the actual behaviors so mariam is now talking so hi my name is maryam and I'm 18 and then miriam is walking so there you go so let's fix the space , so we have to add a space here and I think we can delete this first printed statement here just like that and what I'm going to do is take Miriam and I'm going to put it here so that everything is organized like this and we have a print and then we just let's have some lines like that now let's run it one more time and there we go so here you can see hello my name is john and I'm 22 years old john is walking hello my name is miriam and I'm 18 years old and finally maryam is working so there you have it Now you know exactly how to create classes how to define properties and behaviors if you have any questions about classes please let me know otherwise let's move on it's time for us to put our skills to use.
What we are going to do here is create an application that will ask us a series of questions and at the end we will answer the questions. The application will create a cv that we can use, so this will be a really interesting project for us, so also We will be incorporating text to speech capability where the app will talk to us or you and ask you questions. So this is going to be really cool, so go ahead and make sure you're comfortable with the basics. If you have any questions, go ahead and let us know in the group.
Literally, just let us know and we will be there to help you without further ado. Come on. let's go ahead and start this cv maker app, so let's go ahead and build this amazing cv that you can display as your portfolio, so for this project we need to install a package that will allow us to write documents, so let's go ahead and open the terminal, so what we're going to do is navigate to the view and then here you have the terminal here or you can also see the terminal here and then you can say new terminal, so both ways work if I press that, you can see that.
Now we have this terminal, so here we can type some commands, so this might be a little different than yours, but whatever we type should work if you have installed Python correctly, so let's go ahead and install the package that allows us to work with docs to do that we're going to type pip and then 3, so pip 3 is the package manager for Python and we can basically download existing packages that other developers have written and made available for anyone to use. in our case we want to use this library to give us the ability to write documents and instead of writing the functionality ourselves we can just reuse some code that someone else has already written and there are thousands of these packages that you can explore to install a package say pip 3 and then install and then the package name is python dash and then docs like this and you can see this now activates and downloads the package so now you can see it successfully installed python docs 0.8 .2 so this is the real version so if this command doesn't work for you for some reason try running pip 3 install and then just document like this so there are two versions but they are both the same package but only if the first command doesn't work for you, now we can close this window and go ahead and use this library that we just installed.
To use a library, we will learn something new that we haven't done. done before, but type from and then docs and then import the document, so what we are saying here is from the library that we just installed, we are going to import this document right here and the way we use it is as follows, like this that creates a variable, so I'm going to say document equals and then document and here we have to invoke this just like that with a set of parentheses and you've seen this before, the same thing you saw before we had mariam and then equals to two and then person and then we passed the name correctly, so I think it was mariam and then she was 18 years old.
So the exact same thing happens here, but here we are not passing anything inside, so now let me delete this and now we need to create the actual document, type document dot and then save and here we need to pass a string and this will be the name of our cv or document, so here it will be cv dot and then docs like this, now let's move on. and run this so click on the play button and there we go this ran successfully but you don't see anything so let's close this and now open explorer and check this we have our cv.docs so if you click in it.
You can see we can't really open this because it's not supported by vs code, but we could install a plugin, but what I'm going to do is open it in my file system, so I'm going to close this. and then here what I'm going to do is I'm just going to close this first and then I'm going to slightly resize my window and then I'm going to open the folder and what I'm going to do is I'm just going to make this a little bit bigger, just like that and I hope I can put it like this and then let's try to put it here so we don't have to keep opening this every time, so let's go like this and basically I have two files here, so we have the cv and our Python file, which is the one you see here.
Now if I open this cv and check this, we have an empty cv, so hopefully this is really cool. You've made it this far below, let's move on and learn how to add text to this document. Now let's learn how to add a piece of text in this document, so let me close this for now and inside the vs code, what we're going to do is. a bunch of stuff between creating the document and saving the document, so we create a document, do some things in between and then save it, so here let's go ahead and have a variable that will hold the name of the phone number. and email so let's go ahead and create a variable just let's say name equals nelson and also have an underscore phone and then number equals two and this will just be zero zero zero for now okay and finally we have email equals to two and then hello friends code.com, so what we're going to do is take these three variables and then add them to our document or cv, to do that we have to say it here, we have to say document point and then add and then paragraph like this. and here what I'm going to do is press enter so this is on a new line and what I have to do is pass the name so let's just say hello for now I just want you to see that if I run this you can Look, it worked, let me close this and then open the document.
You can see we have "Hello" right here, so let me expand on this. There we go, so we have "Hello." What we want is the real name, phone number and email. And? what we're going to do is delete this string right here and we're going to say name and then more and then the quotes and in between let's add this pipe more and then the phone number the same pipe and let me make this a little bit smaller so it fits all under one line like that and then another pipe here and finally send a cool email so that's all we have to do if I run the program and complain because I missed the plus sign so here I need to concatenate this too and there you have it, so now if I run it you can see that it works and if I close it open the document and you can see that we have Nelson here zero zero and then a low friends code.
So what I really want is to take this name, phone number and email coming from the console as input and you've seen this before, so what we're going to do is instead of Nelson, I'm going to say input and then here . what is your and a name, a question mark and another space. We're going to do the same thing for the phone number, so I'm just going to take this command and paste it in, and the same thing for the email, but instead of the name, I'm going to say phone number and then what's your email now if I run the program check this so at the bottom we can add our name so here I'm going to say for example ebba and then the phone number is 0 three just a random phone number and then the email will be ebba in and then gmail.com goes in and now if I open the cv, there you go, you can see we have ebba and then the phone number, so let me expand it so you can see everything properly.
Always go 033, this is the random phone number and then the actual email. There you have it. Now you know how to receive information and then store it in a document. This is just the beginning of your CV, but at the end of this section. It will look super amazing. Next, let's add a profile picture. Okay, to add an image to your CV, go ahead and grab any of the images you may have. If you don't have an image right now, what you can do is navigate to pixels. com and then here you can search profile and then image and then you can use one of these images to download it to your local computer and follow it, so in my case what I have is my profile picture here.
So what I'm going to do is take this file and then put it inside of Learning Dash Python. This is our folder where we have our Python file. Now let me go back and you can see that we have the profile picture here. So what we're going to do is let me close this document and then this too, just before, here, just before this name variable, what we're going to do is add the image, so adding an image is really simple. say document dot and then for paragraph remember here it said add and then paragraph and for image it says add underscore and then try to guess you guessed right so add and then image like this and then inside we have to spend some things one is the file name so in my case it's me dot and then png so this is the file extension and you can see right here my dot png and if I run this you can see we have to enter the name . let's say nelson this time and then phone number zero zero zero hi on and then friendscode.com goes in and now if we open our cv right here look at this the image is in our document so this is really cool sokeep things organized, then we have the title and we have called skills again, you can name this whatever you want and then we have the actual skill and this comes from the input that comes from the console. then we have our paragraph and then we style it because this time we want a list bullet and then we do the same thing that we did with the experiences but here we ask that the user has more skills and the question is does he have more skills yes or no If the answer is yes, we want to do exactly the same thing that we did here and finally, what I did here is add a footer to our document.
To add a footer, you need to access a section correctly. here, so we just go to the first section and then we grab the footer of that section and then we're in the paragraph, so here we say p for the paragraph that comes from the footer paragraph and then here we're just setting the text for the cv to generate the friends code and in the Quickbooks course project and this is the solution for the exercise. Now let me go ahead and run it so you can see some action here. What is your name? Nelson phone number zero zero z oh actually 999 whatever and then hello to friendscode.com and then here I'm going to keep things simple, but what I'm going to do here is let me go to google.com obviously and then here we go to search. for lauren and then ipsum and feel free to add information, but basically here we can take random text, so let me take this and we can take random text that we can use, so here I'm going to take that and then put it in. here enter enter the company so here I'm going to say inside and then quick books there we go and then from 2017 to 2019 and then experience and I think we're missing a space there, so experience here let's say social and then media and then admin enter do you have more experiences? let's say yes and then here friends and then code and then from date 2019 to 2020 and then say python developer and then enter do you have more experiences? let's say no for now and then enter a skill, then let's say python and then you have more skills, say yes and then here let's say marketing, do you have more skills?, say yes and then say here, for example, management, enter, do you? do you have more skills?, we're going to say no, so n and There we go, so now let's review our CV, so if I open it up, there we go so you can see our CV looks really great, so obviously we could have added more text here, so something like that, um, but obviously you can put something. real information, but you can also see the skills, so this is a bullet point and we have our footer, so the CV was generated using the friends code and the Quickbooks introductory course project, so there You've got it, now you have a CV that you can put in your portfolio and this is just the beginning of your journey.
Next, I want to show you one last thing that I think you'll love. Install this library that can take any text and then convert it to speech, let's go ahead and open it. configure the terminal here, then terminal or command line if you're on Windows and then a new terminal and you've seen this quite a bit, this is where all the output from our program appears to install the type of text to speech library. pip and then three and then install pi and then t t s x three so this means Python text to speech and then x three is the version so let's press enter and now this goes ahead and install the library and it's as simple as that and then use it let's move on and let's close this and at the top let's import the library, so type import and then pi text to voice or pi tts x3 and that's it, this is pretty much all we have to do now.
What we do here is the following right after importing, let's go ahead and say pi t ts3 and then tap and then talk so we have a talk method and here we have the text, in single quotes, say hello, let's run this and see what happens. and you can see it says hello, so this is really cool, so let me close this and what I'm going to do here is this: I'm going to create a function that's going to wrap this so we don't have to. Always say pi and then tts then inside paste this to the right and instead of hello we're going to pass the text like this and now it means we can call this function right here and not have to say this. pi tts x3 so right after we add our name, let's say here talk and then we want to put hello in quotes so hello and then more and then name and then more and then how are you today with a question mark? and let's run the program now and You can see it says what's your name, so here let me say, for example, ebba, hello, how are you today? and you saw that he said hello, eva, how are you today?
So I'm going to cancel this because I don't want to fill out the CV right now, but you see with this you know that you have so many right ideas, so for example, you might want to take this method of speaking and then, for example, asking the right phone number, so let's say talk and then you want to take this question and then put it here and then paste it, so if I run this one more time, let me say nelson, wow, I want to write here, so let me say nelson, hi Nelson, how are you today?
What is your phone number? and you can see now I can put my phone number in correctly so this is really cool and for email we're not using the talk feature so there you have it so I just wanted to show you this amazing package because it's pretty amazing . of how much you can do with programming, so that's it for this video, let me close this and I'm going to press Ctrl.nc here to close this program and then close it, so that's it for this video. If you have any questions about this, let me know, but yeah, I had fun showing you this whole project.
I hope you had fun too. I think the next thing for us now is to take this project and then prepare it so that we can build a portfolio and that's what we're going to do next so that we can take this project and make it available to others. people will see it and maybe they will want to download it and experiment with this project as well. We have to do one thing, so what I'm going to do first is open the terminal or the command line if you want the new Windows terminal and I. I'm going to say pip and then three uninstall and then python dash docs and then say y for yes and also say pip nn3 and install and then pi and then t t s x and then three and then enter say yes or y actually and now try to run the program so that You can see this gives me an error and it says module not found correctly and this is because we removed the package, so if you were to send this project to a friend of yours, you would have to download those two packages manually. and what we want is to facilitate the installation of those packages with a single command, for this what we are going to do is use a file called requirements.txt and then we will have all the packages that this application needs and then we only have to execute a single command to download the packages specified in that file so open the explorer tab and then here let's create a new file and then name it requirements dot txt and inside this package and let me close it for now inside this file we want to have the packages that this application depends on, so we depend on Python.
Wow, so Python Dash and then docs and then equals equals and then version, so the version we have. we were using was zero point eight point and then ten and we also depend on that and a new line so pi t t s x and then 3 is equal to 2.90 so make sure you have exactly the same thing here as I do now let's save this file and then close it and to test this, let's run the application again and you can see that no module name fits well, so what we're going to do is close the explorer tab and then what we're going to do is say in the down below we're going to say pip nn3 install minus r and then requirements dot txt now press enter and you can see it's using um the dependencies inside requirements.txt were used to go and download the dependencies so now you can I see that if you push this application to another person all you have to do is just run this command and then that will pull all those libraries into the project which means we can run the application so if I click play you can see we have what's your name here I go to say ebba hi how are you today and what is your phone number and you can see it is working as before so there you have it this was pretty much the last thing we saw that has to do with this project, next let's take this application and then save it somewhere you can display it as your portfolio.
I hope you learned a lot from making this app, so now what we're going to do is take everything that we've built together and you're going to create your first portfolio, so this is when you can show it to employers right when you start applying for jobs, this is where you will have all the projects you make, you should store them. where I'm about to show you, it's a very popular way for people to show their work and this is very important for you to give you the boost you need, so I think you deserve it.
Let's go ahead and create the portfolio together. To build our portfolio, we will use this website called github.com and basically this is a website for developers where you can work collaboratively with other developers and you can store all your code on this website, so go ahead and create an account and a Once you have an account you will have something like this, so here I have a list of projects, on the left side and these are called repositories, so for you you might have zero, but let's go ahead and create your first portfolio, so go ahead and create a new repository and then here the owner, this will be your name and then for the repository name, I'll say python and I'll quickly go in and then the books project, so this might be a little bit shorter for you. but for now this is going to be my name and also what I want is to make this repository public so anyone on the internet can access this repository so make it public and then add a readme file here so I'll show you this in a second, go ahead and create the repository and there we go this is our repository so it might look like this so now what we're going to do is add our python files and images and everything we need to add so here add file upload. files and then we can take all of these files properly and then just put them inside, so four files we have the cv, this is the actual cv, this could be optional and then we have the Python file which contains the source code and then my image. and then requirements.txt, so now I'm going to commit the changes here so you can see that the files are here and I'm going to say commit the changes, so it's done and now you can see that we have a In a couple of files, you can see we have our CV, this is the image and this is the Python code, so if I click on it, you can see if I zoom in you will see that this is our Python code, so remember.
We wrote all this together, so now this is a place where you can show your work, so let me back up a little bit or zoom out a little bit and click on the project and here what we're going to do. is next, click on this pencil and we're going to change this a little bit, so let me remove the dashes, here we go and what I'm going to do is open an issue, so click on the issue. so I'm going to press command and then to a new tab or you can right click open the link in a new tab and then here a new problem and what I did.
I went ahead and I have a screenshot of the actual CV here, so let's take this image and then put it inside this comment and all we want is just this link here, copy that, close this and now here paste it and we also want to have some description, so here we're going to say um pound sign twice. and then installation and then here add again ticks let me zoom in so you can see everything bad and then python install r requirements dot txt remember that this is how we install the dependencies listed inside this file, so here let's say run and there we go, now if I zoom out a little bit and then scroll down, let's commit the changes and now let's review this for Python to go into the Quickbooks project installation and then this is the command and then this is our CV, so there you have it. it's really very good so this is your portfolio now you can see this is the friends code slash in the project name so you can grab this so if I click here you can grab this link and then share it with someone, whether you're applying for jobs or just showing it to your friends or you can send your username to your github username, so if I click on my friends code, this is the list of all the projects that I have correct and if I go to the repositories, you can see it. hethat we just created Python in the Quickbooks project, there you have it, now you have a portfolio.
Well, then it was a pleasure to teach you about Python. You have come a long way and I can tell you that this is just the beginning. For you, the next step is to check out my other course on Python, where I go in much more detail about some of the most interesting things that this language has to offer, also if you are not part of the code friends community. Go ahead and join, join both the private Facebook group and Discord. I would love to have you there so you can share your experience with other people.
Finally, what I'm going to do for you is in December. I'm going to have a question about where. You can ask me any question you want, so go ahead and fill out the Google form in the link below and I'll let you know when the question will be asked. It was a pleasure teaching you and I can't wait to see how. How far are you going on this journey?

If you have any copyright issue, please Contact