Python Tutorial for Beginners - Full Course in 3 Hours

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's going on guys assalamu alaikum welcome to amigos code my name is nelson and in this course you're going to learn how to code this course wouldn't be possible without the collaboration with intrigue quickbooks we decided to package up this course to give you everything you need to kick off your career in technology we know during this pandemic things have been really hard but we want to give you the knowledge that you need to explore technology as well as programming in this course i'm going to make sure that you understand what programming is what you can do with programming and then we're going to 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 you'll learn how to write some code execute some code learn about core concepts such as classes loops variable functions and a lot more but more importantly we wanted to give you everything you need to give you the boost right so towards the end we're going to build together an application that can ask you a series of questions either text or voice and then it will generate you a cv then we're going to take that cv and we're going to build together a portfolio and this can be your starting point literally this can be your starting point and you'll see that programming is not that difficult a lot of people think that programming is just for people that know lots of maths or really clever people but don't you worry i'm gonna simplify things so that you fully understand this awesome programming language if you're new to my channel go ahead and subscribe it means a lot to me also join the private facebook group as well as discord because the community is growing there are over 10 000 people learning how to code and you should be part of it without further ado let's kick off this course join me inside right before we begin this course i just want to tell you that as you follow along i want you to practice literally just follow through every single example get ready get your laptop ready and let's practice practice practice practice that's the only way that you will benefit from this course and i really want to add value but you need to practice as i teach also join both facebook as well as discord because the community is there to help you i don't want you to feel alone in this journey for discord i've created a dedicated channel for people that enroll to this course that way if you have questions we're going to be there to answer every single question that you have but also if you live in the uk we're going to be sending out freebies to you guys this is all i wanted to say without further ado let's kick off this course for this course you're going to learn about python python is a programming language so programming language is a language that a computer can understand the same way that we have different languages i.e spanish english french portuguese so on and so forth it's the same way when we talk to computers so we have python as one of many programming languages python is really suitable for beginners because it's easy to learn and in this course i want to make sure that you fully understand this language with python you can do many things right you can build websites you can build games you can build desktop applications web applications if you are into machine learning if you are into data science python is the tool for you right but don't you worry about these things too much because first let's understand how to use this language and then you can decide which path that you want to take so now that you know what python is let's go ahead and install python in our local machine so i'm going to be using a my computer but this setup that we're going to go through will work for both windows users so let's go ahead and navigate to google.com and in here and type python so just go ahead and simply type python and you can see that we have this page where it says welcome to python so this very first page so python.org and in this page right here you can see that we've got the downloads link so go ahead and click on downloads and right here because i'm on a mac i can see the download link for mac os but if you are on windows simply click on windows or linux you can simply use the version specific for your operating system which is cool also right here you can see that these are the active releases so the active release right now so the latest one is 3.8 right here and if i show you so 2.7 has reached end of life so you shouldn't really be using this version right here and if i scroll down you can see that we can have um you know specific release versions right but usually just go ahead and download the latest version which has support until 2024. so right here you can see that the latest version as i speak is 3.8.5 you might 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 simply download python there we go let's finish now let me open up the downloads folder and in here you can see that i've got python so let me simply click on it and let me just collapse this so the installation process for both windows and mac os is really straightforward you just simply have to press continue and then agree and then install so before i actually press or actually put my password if you are on windows make sure to tick the box that says add python to the path right so that's really important so that you can use python from your terminal so on the mac it does it for me so right here let me put my password install just give you a second and there we go so we've successfully installed python next let's go ahead and install a program that will allow us to write python code right now that we have python installed in our machines we need a way of us writing some python code in order for us to write python code we need to use a text editor so the same way that if you write english or you want to write some documents you use for example microsoft word well when it comes to programming we have specific text editors that allows us to write code in any programming language and the text editor that we're going to install to write some python code will be vs code so vs code is an amazing text editor built 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 in 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 to write any code in the other different programming languages so this tool is actually made by microsoft and it's very popular so that you know now let's go ahead and download so simply click on download and then in here you can see that we have different operating systems so if you are on windows click windows if you are on linux click linux if you are on mac click on mac so the installation process is very straightforward so in here because i'm on a mac i'm going to download for mac just give a second i'm going to allow now to download and there we go and there we have it so i do have this visual studio code app right here so this is the actual application itself and if you don't see this on your desktop it's because you have a different destination when you download applications right or files most likely it will be inside of the downloads folder now what we're going to do is we're going to take this application and then put it inside of the applications folder and only do this step if you are on a mac computer now let's collapse this and then let me open up the finder there we go and i was saying so if you don't see this file inside of desktop it's most likely inside of the downloads folder now let's open up applications so this is where we have the list of all applications and all we got to do is just put it inside here and there we go it's as simple as this now we can click on it you can see that we have vs code installed all right so what we're going to do is create our very first python project together so what we're going to do first is create a folder in our desktop so right click and then new folder and then name this as learning and then dash python so this is the name of the folder now what we're going to do is inside of vs code you can see that we have this section where it says start you can see new file open folder add workspace folder so click on open folder and then navigate to desktop and then select the folder that you've just created and there we go so now you can see that this is the name of the project learning dash python so it's just the actual folder that we have specified so here you can see that we have this welcome tab we can close it because we don't need it and what we're going to do here first is to install a plugin for python so vs code allows us to install many plugins for working with various different languages so if 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 will give us a lot of features when it comes to work with python and you'll see this in a second so in here you can see that we have these little squares and in 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 for python and then just select the very first one so if i select that one you can see that it has 26 million downloads so it's quite impressive so in this page you can scroll down you can see what this plugin is all about but you're going to learn very shortly what it has to offer so let's install this plugin so click on install and that's done you can see that it says this extension is enabled globally so the quick start section here you can see that it says install the plugin and then step three open or create a python file and start coding so let's do that so we're going to come out of this extensions tab so click on explorer in here and inside of learning so you can see that we have a couple of sections here but in here so learning 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 as my and then underscore and then app and then say dot and then py so this is very interesting uh when you say dot py so something is happening here so if i remove dot py you can see that in here we have these lines right and as soon as i say dot py check this out we have the python logo so what this is saying is that we have a file that has the extension of python so if you want to work with python every single file that you create has to have the dot py so the same for example if you want to work with a different programming language let's say javascript simply type j and then s and you can see that we have the javascript logo if i want to work with java i can type dot and then java you can see that the logo changes right and basically you have different extensions so the same for example if you have worked with microsoft word for example this is the um file extension so dot and then dock and you can see that we have the microsoft logo right there so because we are working with python we need to say dot and then py every single file that we create has to have the py right 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 just like that and then i'm going to press command and then plus so i want to zoom in so you can see everything what we're doing so here you can see that vs code is telling us that linter pylint is not installed so this these are just extra extensions so just install and just give a second and basically if you see any other things that needs to be installed for python just installed there are extensions so let me close this and then close this file here and now check this out so if i close the extension tab as well so here now this is our file so if i close this again so i want to show you so here we have the my underscore app app.py click on it and you can see that this is our python file so in here we can start writing some code and that's what we're going to do next let's write our very first python program so what we're going to do here is the following so inside of this my underscore app.py you can see that we have this line number here so if i click on this file you can see that we have the cursor so here this is where we can start writing some python commands to build any program that we want so in here if i press enter you can see that we are getting these line numbers right here and they represent the number of lines of codes that you currently have so currently we have zero lines right oh actually we have one line which is empty but let's create a python program that will print to the console hello world so what i'm gonna do is if i first make this bigger because i think it's best if you see it properly and in here i'm going to hide this panel right here so click on explorer and that will hide if you need it again just click on it and you can see that it brings it back so let's just hide that for now and in here we're going to write our python program so let's type together so print and then open parenthesis and then add single quotes so if you press on the single quotes that will give you two quotes but if you have one just add another one and then end parentheses just like that so here what we're going to do is say hello and then world so this is a very common program for beginners right so hello world and now to run this program let's click on this play button so this will run the python file in the terminal so if i click on it you can see that we have some text but if you look carefully we have hello world and this is our very first python program so let's close this and let's change this a little bit so before we print to the console let's type together name and then space equals to and then type input and then inside of this input let's add single quotes and then what is your and then 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 this will now contain anything that we input from the console and what we want to do is to say hello and then instead of world we want to remove the word world and then have a space in here and then space after this quote and then plus and then name just like this and basically we are saying we want to print hello plus whatever we pass to the console so let's run the program and now if you look carefully in here we have what is your name and basically we just have to type anything here so for my name i'm going to say nelson and make sure that instead of nelson you have your name so here i'm going to press enter and have a look we have hello and then nelson so if i run it again and then let's say that the name here is maria and then enter and you can see that we have hello and then maria so if i close this and there you have it you successfully created your very first python program right let's go ahead and learn about a very important concept that you need to know and that is variables the way that i like to explain variables is by using the box analogy so in programming you can think a variable as a box right so imagine that this is a box and now inside of this box you can store literally anything that you want for example you could store number four inside of 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 right so the name the name would be for example number right so when we say number we get the value that's inside of the box right so you can store numbers but you could also store letters right sequence of characters and you'll see this in a second so for example let's say that this is a sequence of characters so k for example and let me just take for example b from here right you put it inside and you can add more letters right but you'll see in a second how all of this works right so now here so this box has some sequence of characters right and i also have to give it a name so let's say that for example this contains um a name right of of a person so here i could just say that this box name is jamila for example right because it has the value inside of jamila right so if i take this you could also oops you could also store an emoji and by the way just give me a thumbs up if you're enjoying this video but you could also store an emoji and literally you could store anything i can take my phone put it inside here right it doesn't fit but you know this variable now holds my phone and you'll see um how to to represent things in the real world later on with python right by using classes so there we go so a a variable it's simply a box that you can store literally anything inside and as you saw with our example where we have name equals to input right so name was the name of the box right and then the input was whatever the user typed on the console was stored inside of the box and then when we printed the name it just took the contents inside and then it just gave it to us that's why you saw on the console the output of the name but you'll see lots of examples throughout this course but i feel like this is the easiest way that you're going to learn what variables are in programming let me go ahead and show you exactly how to use them all right so let's go ahead and delete the previous example in here and to create a variable in python it's very straightforward so here we have to give it a name so any variable that we want to specify has to have a name for example in here i can say name and then equals and in here i'm going to type single quotes on both sides and this variable will have the value of jamila so this variable has the value of jamila now again think of a variable as a box right so a box that has one and only one thing inside and in our case the box has the contents of jamila and we have named the box as name we can also create a different variable right here let's say age so this variable h right here equals two and then now we can say 18. so let's say that jamilah she's 18. and we have a second box named age that has the value of 18. so remember that i said with variables we can store anything that we want so in this case you can see that we are storing a number so 18 this is a number and in here so name is storing a sequence of characters and in programming a sequence of characters is called a string so a string so let me actually type this to you so string like this right so this is what we represent as a sequence of characters so this is jamila and then 18 instead of number we say that this is an integer and in fact if i put my mouse in there you can see that 18 and then column and then int int stands for integers and integers are whole numbers now let's create another variable so here i'm going to say pi equals two and then three point one and then four and now this number right here is different than this one right so this is a whole number and this is a decimal number right here and if i put the mouse there you can see that now it says 3.14 column and then float right so these are decimals and these right so you see that we had strings we have integers we have floats so these are data types so they are called data types and i said that if you have a variable so if i say a variable and then equals so inside of any given variable you can store anything that you want and that thing inside of your variable has a data type so you're going to learn more about data types but i just want to show you the basics of creating variables so let me show you another data type so for example if i say cars equals 2 and this time add square brackets on so open square brackets and then close square brackets right and then here let's add single quotes and then type bmw so this is one car comma and then single quotes and then here let's say mercedes and finally let's have one more car and then this will be wrench and then rover right so you can see now this variable right here so cars right so if i put the cur the cursor on cars so the data type now is a list and we're going to cover more about lists but basically lists allows 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 mouse on the name variable here you can see that this name is a str and sdr stands for string h this is int pi this is float so floats are decimal numbers and in cars so this one here is a list this is how you create variables with python and obviously we can print these to the console so type print and then name and then age we can also print pi and finally let's print cars just like that and if we run the program you can see that we have jamila 18 3.14 and then the list of cars right let's learn how to work with strings so strings are very important in programming and you will end up using them quite a lot so in here we have a variable name equals to jamila and let's have a second variable say surname equals to and then smith right here so jamila smith and what we want to do is to have a second variable so full so we're gonna name this as full and then underscore name equals two and we're going to name this and what we want to do is take both name and surname and then store them inside of full name so for this we can use the plus sign so name and then plus and then sir name and in fact this should be first name so first underscore and then name and in here first and the score and then name so this refers to this variable surname refers to surname so now let's print to the console and then within parentheses we want to say full and then name so if i run this program you can see that we have jamila and then smith now we actually need to have a space here so let's do it so let's close this and in here we're going to say plus and then add single quotes space and then plus and then space and then surname so if i run it you can see that 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 with it so let's say that you want to find out the number of characters that first name has so type print so we want to print to the console the number of characters that this first name so jamila has so type l e n for len and then in here add parentheses and then inside pass first and then name we can also print and then parentheses and then len parentheses and then surname so if i save this and then run and you can see that jamila has six characters and smith has five characters right so if i close this again one other thing that i want to show you is which strings let's say that in here so jamila right so jamila has lowercase j so if i save this and then run it you can see that we have jamila lowercase and then smith uppercase right but we want to have an uppercase in here so j uppercase the way we do it is in here so with this variable right here we can say dot and now we have a list of methods that we can use with strings and again i'm going to cover methods later on but here you can see that for example we have a bunch of methods so is lower is numeric is upper join lower split title so on and so forth so let's use this method here called capitalize and then end this word with a set of parentheses just like that if i save this and then run you can see that now jamila has a capital j so just to give you one more example so let's say print in here and let's say full and then name dot and we have a list of methods here so let's uh say that ends with so we want to check whether this ends with and then this string right here so let's say that ends with hello so run this and you can see that we have false right so if i close so jamila smith so the full name doesn't end doesn't end with hello it ends with smith and you can see that we have true so we haven't covered this value right here so true or false but don't worry i'm going to explain exactly what these mean in a second this is how you work with strings obviously there are a lot more that you can do with strings but this is just a quick introduction on how to work with strings with python all right let's learn how to work with numbers in python we can use any of the arithmetic operators that you are used to so plus minus division multiplication just like that and then we have one which you might not be used to but this is modular right so this is the modulus 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 that you want to add two numbers so let's say that you have a variable and we're going to name this as addition equals two and then you want to add 10 and then plus and then five right so we know that 10 plus 5 is 15. so here i can say print and then edition and i've got typo so this should be a addition and in here addition as well and then run the program you can see that we have 15 right here so i was actually right so we can also subtract numbers so let's say subtract or subtraction equals 2 10 minus and then 5 let's also do a multiplication example so multi application equals to 10 and then times and then five so the times is just a symbol star right and then five and let's do a division as well so division equals to 10 divided 10 and then divided so this is a symbol and then by five now let me print these 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 this is how you work with numbers and perform arithmetic operations on them so one last one that i want to show you is the modulus so mod i'm going to call it mod and in here equals to and then let's say 10 and then mod and then 5. so this is an interesting one so print i'm gonna say print in here and then we want to print mod so if i save run you can see that we have zero so let me explain this so what this is saying is how many times five goes into ten right so five goes into ten two times and what is the remainder so mod is simply the remainder right so five goes into ten two times and the remainder is zero hence the result was zero if we say for example three right so we have three here so how many times three goes 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 let me give you yet another example so if we have four for example right four goes into ten two times and then we have two as the remainder right so four plus four is eight and then if you add two we get ten so two is the remainder and you can see that we have 2 in here so there you have it this is how you work with numbers and perform arithmetic operation on them sometimes you need to know whether an expression is either true or false and this is when the boolean data type comes in so you saw that before you saw this value true and you also saw false right so you saw these two values here so true or false so these two values are used when you want to know whether something is true or false so just to give an example let's say that we want to print to the console we want to say whether 10 is less than 10 for example right and remember maths so this is the uh less sign right so the way i remember these signs is this one right here has like a l shape and it means less basically so we want to know whether 10 is less than 10 so this will give us false in here see that the result is false so we can also use 10 is less or equal to 10. so this is actually true you can see that this is true so here let's have a couple more examples so print and then let's say zero equals so we can say two equals to check whether and two values are the same so zero is equal to zero let's say 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 dot and remember the method that we use ends with let's check whether jamila ends with and then have single quotes in here and then s yep so if i take this line so i'm just gonna command c command v so copy and paste and change that to a so if i run this you can see that we have true true true false and then true right so these are the expressions so 10 is less or equal to 10 it is true zero equals to zero and let's just change this to uh one for example right so zero equals to one this will give us false eighteen is greater than five jamila doesn't end with s right so this gives us false and then we have jamila ends with a of course she ends with a right here uh well actually the name jamila ends with a so if i save this and then run it again so we have false in here so this false here is 4 0 equals to 1 which is false so there you have it this is how you have expressions so these are expressions that return true or false so these values for example if i say is and then underscore adult so i can actually store the value true in there and then is thin ager equals to and then false so i can store the values true or false in here right so i can also print these and will be actually true and the value of false but these expressions they 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 boolean data type the reason why we have this boolean data type so either true or false is because they allow us to perform decisions when writing code so let me go ahead and and remove all of this in here and let's just say that we want to have is adult equals to true right so with python we have something called if statement and what the if statement gives us the ability to control the flow of our program so here this is how we use the if statement so if statements they work with boolean expressions so here i'm going to say if and then is underscore and then adult so i'm just saying if underscore adult and then add a semicolon here add a semicolon and then press enter so if is adult i want to print to the console is an adult right i want to print to the console is adult so if i run this program you can see that we have is and then add also this is actually printing is adult if i close this and then change this to false i want to see that if i run the program we not printing 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 equals to true we're going to execute this piece of code right here otherwise if it's false we're not we're not even going to execute this piece of code here this is what this is saying so if i change this to true this will actually be if and then is adult so if it is true we'll print line four else we're not printing anything right so this is why we have these boolean expressions so just to give you another example so here instead of saying is adult what i'm going to do is have a variable here i want to say h equals 2 and then 18 right now after is adult let's have another if statement so i'm going to say if and then age and then greater or equal to 18 add column and then enter we're going to say print and then inside you can say adult and i'm going to show you another keyword so else and then column and then print and then add these single quotes not and adult and if i run the program you can see that we have adult right because this expression has evaluated to true so if this is true this will be printed and this will be skipped but if this expression is false this line will not get executed but the else will be so if i change this to for example 17 run you can see that we have not an adult so this is how you work with if statements and booleans so one thing to bear in mind here is you see that it's very important that you indent so here you can see that i'm pressing tab to indent this piece of code right so anything that comes after this if statement has to be on the same level has to be indented i.e on the same level as print so if i do this this will not work so if i save this and then run the program you can see that we have an error and it says indentation error expected an indented block so you can see that it's even red now so if i indent this i've just pressed tab and then save and now the error went away so the same here so if i do this this is invalid so we need to indent this so there you have it this is how you work with if statements and booleans right now let me teach you about this data type that you've seen before called lists so earlier in this course you saw that we had this variable called cars equal to and then we had square brackets so this is a list that you can store more than one value so the difference here between so for example if i say car equals to and then b m w right so the difference between this variable and this variable is that the data type for cars is a list so if i put the cursor there you can see that it's a list and what this means is that we can store more than one value whereas in in this variable which is a string i can only store bmw right i can only store a sequence of characters so let me delete this so here let's say that we have uh three cars so let's say that we have a bmw and then here let's say comma right so after a single quotes comma and then let's now say that we have a tesla and comma and let's finally say that we have a mercedes here right so this variable cars is a list that has three items in it so if i say print and then len i can say len so for length and then i'm gonna pass cars inside and then run you can see that we have three items in it so with lists let's say that you want to access this first item here so bmw the way you do it is as follows so i'm going to say print and then cars right so if i actually save this and then run you can see that this gives us a list but what we want is to grab just the first element the first item in it so let's say print underneath and then we're going to say cars and then add these square brackets and then the way that you access this first element is by using an index so with lists the index starts from zero so this is position zero position one position two right is not position one position two and position three when we work with computers the numbering system always starts with zero so in here we want to say zero so cars and then zero so let's grab this line let's duplicate it two times and then here this will be one actually one and then two and then run you can see that 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 so if i say print or not even print i can just say cars and then let's try and access position three right so we know that we don't have a position three so zero one and then two right we don't have a position 3. so if i save this and then run you can see that we have an error and the error says that list index out of range so if i was to add a second or actually another car so if i for example say toyota just like that and here we can now say print there we go and there you go you can see that we don't have any more errors and we are accessing the index number three which which contains the value of toyota so this is an introduction to lists in python if you have any questions please do let me know otherwise let's move on now is the perfect time for us to learn about about loops in python you saw that if we want to access any item in this list right here so cars we need to say cars and then the index so cars index 0 index 1 index 2 index 3 if we have another car we need to say print and then cars index 4 right but we can do something much better than this we can use loops so loops allows us to write some code that will automatically loop through the list allowing us to execute any piece of code that we want so let me delete all of this and the way that we can use loops is as follows we can say 4 and then car in and then cars so add semicolon here and print so inside say print and then car so you can see that now instead of us saying car and then index zero index one index two index three we just saying four so this is the uh for loop construct so we're saying four and then this here is a variable that will point to each individual item in this list and then i'm saying in and then cars so loop in cars basically this is what is saying right so if i save this run the code you can see that now we have bmw tesla mercedes and then toyota so if i was to have another car so this time honda and then save this run it you can see that it automatically loops through every single item in the list now let's do something with this car right here so let's say dot and then capitalize and then save run it you can see that we have bmw in fact let's just say that in here let's just say if we're going to say if and then car equals to bmw we want to do something so here we want to say a print and then car dot upper so we want to fully uppercase instead of just having the first letter in caps and then i'm going to say else so else we want to just capitalize right so here we need to indent this because this print statement belongs to else so here just indented like that and now we're saying loop through cars if the car is equal to bmw we want to uppercase everything otherwise we just want to capitalize and capitalize just takes the first character and then puts it in uppercase if i save this and then run check this out we have bmw all caps tesla mercedes toyota and honda all having the first character in uppercase so there you have it this is how you work with loops in python so loops just allows you to loop through any list and then you can execute any piece of code while looping through the list if you have any questions on working with lists please do let me know otherwise let's move on in python we have another way of looping and that is using the while loop so the while construct allows us to loop while a boolean expression is true as soon as it's false then the loop terminates so to demonstrate this let's say that we have a variable so let's say number equals 2 and then 0. so we want to print to the console the number as long as the number is less or equal to 10. so to do that we can say while so this is the construct so while and then we can say number is less or equal to 10 and then end this with column and then enter and make sure that this is indented right so if i start typing from here this is not valid code so we have to indent this and you see that if we press enter it just puts us where we have to be so in here i can say print and then number so if i save this and run this program i just wanted to let you know that this program will run forever so check this out i'm going to press play and you can see that this is actually printing zeros and it's actually running right and this is because so what i need to do is actually press ctrl c in here right so we've just stopped so the reason why it's running or the reason why it's printing zero all the time is because we told it to do so while zero is less than ten so what we want to do here is say that we want to increment the value of zero so to increment the value of zero we can say number equals to number and then plus and then one so what this is doing is the following so here the number is zero right so the value of number is zero then we print the number and then i'm saying right so number i'm going to give the number a new value and the new value of number will be the current value which is 0 and then plus one so zero plus one is one then the next time that this goes around number will be equals to number so the current value of number will be one one plus one two and then it goes around prints two so on and so forth and then at some point the value of number will be bigger than ten and at that point we don't execute this loop right here so let's save this and watch it execute if i run this you can see that now the program run and it's finished so here you can see that we have zero one two three four five six seven eight nine and then ten so that is the purpose of while loops so we can loop while a certain expression is true now i can also say in here so i can say else and then column and then print and then i'm going to say in here while and then loop ended and value of number is space and then add a plus and then in here what we're going to do is say str and then pause number so the reason why we are saying str in here so this means string is because we want to take the number and convert the number to a string so here we are concatenating strings and strings right so if i concatenate a string with a number it won't work so we have to say right take the value of number and convert it to a string so if i save this and then run and you can see that after the execution of our while loop it says while loop ended and value of number is 11. so here check this out so if i put this like this so 11 is 11 less or equal to 10 no right so 11 is greater than 10. that's why we skip out of the loop and then we print this else statement so this is how you use the while loop in python if you have any questions please do let me know otherwise let's move on let us learn about functions in python a function is a piece of code that gets executed only when you call it and the main reason for having functions is that you don't have to repeat code so here let's say that we have um here let's say that we have age equals 2 and then 18 and we want to say if and then age is less than 18 we want to print and then oops not an adult and then else print and then hooray i am an adult if i run this program you can see that we have hurray i'm an adult now let's say that we have a different age so let's say age and then 2 equals 2 and then 17 right so now i want to do the exact same thing for this second age so what i need to do is copy all of that paste that in and then this will be h2 right now if i run the program you can see that we have oops not an adult so a function allows us to bundle some code together which then can be used multiple times so in this case what we want to do is have a function that we can just pass age and h2 and then it will perform this logic right here so to do that what we can do is have a function so to have a function we have to say def so this is the definition for creating a function and now we have to give it a name and we're going to name this as check and then age and then in here let's for now just have these parentheses and i'm going to show you why we need these and then column and then here let's simply print and then check age and then function was invoked so the way that we invoke this function right so let's actually run the program so i just want to see so here you see that nothing has changed and this is because we haven't invoked the function so to invoke a function we can simply say check and then underscore and then h and now here we need to invoke it by passing these two set of parameters this is how we actually invoke the function but still this will not work because so invoke the check function but at this point we don't know whether the function exists because it's defined down below so what we need to do is take this invocation here and put it after the function is being created just like that and now if i run this you can see that check age function was invoked so here what we're going to do is the following we're going to remove this print and let's grab this logic so if statement and we're going to put it inside of this function here so put it like that and then make sure to indent this just like that and then in here as well so now i'm going to delete this other if statement because we don't need it and let's now run the program i just want you to see what is happening so here it says hooray i'm an adult right so what we want is actually this age to be passed as an argument so here we have to say age because he's actually reading this age right and we want this function to work with both this age as well as this age so for that we're going to say right so here we're going to receive age and this is called a parameter that we pass inside of the function right so now what we need to do is actually say right so check age in here so this one right here we can now pass any number that we want so we can pass age and we can also say check h and then pass h and then 2 just like that so you can see that we wrote a function which we can now reuse it and it has some logic inside so if i run this program you can see that it still works so ray i'm an adult and then oops i'm not an adult so here let's actually remove these two variables and if i run this you can see that age is not defined of course right so age is not defined but now we can pass any number so let's pass 18 let's pass 17 and let's pass 99 for example so check age 99 and if i run this you can see that it works for any number that we pass so there you have it this is how you create and invoke functions in python and just to illustrate that functions are very important in this language and you when you start your career you will create lots of functions but python already gives us built-in functions so here check this out so here remember we had so here we had let's say that we have this string right here and type hello just like that now here i can say dot and then we've used the upper right so upper and then we have to invoke so here we're actually invoking a function so the same way that we've created our own function so check age so this function is already given to us by the python library so the same with capitalize and then we invoke the function just like this you also saw starts and then with and then starts with takes an argument here so here we have to say uh whether it starts with or i think we you saw ends with right ends with but the other one is checking whether it starts and this one is checking whether it ends with and then we pass an argument right so the same way here so we invoked the function check age and then we passed an argument in here because we defined a parameter here right so in the function this is the parameter and then what you pass inside is the actual argument so 18 is one argument 17 is one argument 99 is another argument and the same here with this function ends with you can pause an argument right so if i say for example print and we want to check whether it ends with let's say capital o and let's duplicate this as well so we pass now o lowercase run the program and you can see that it's false because it doesn't ends with capital o but it does ends with lowercase o so this word here hello and that's why we have false and true so hopefully now you know and understand how to work with functions in python in programming we have something known as classes classes are blueprints that allows us to model anything that we want in the real world or in software let me give you this really simple example so you see this phone right here i can represent this phone in code right so we can write a python code that will represent this phone right here and to do that we have to use classes so classes when we use classes we have two things we have properties and we also have behaviors and actually i need the phone again so the properties of this phone for example there would be the brand the color the price so on and so forth and then behaviors right is what the phone can do right so this phone can take pictures can make phone calls so on and so forth right so classes allows us to model anything that we want in the real world and what i'm going to teach you is how to model a person a real person by using classes right so we have properties so the properties could be the name age ethnicity so on and so forth and then the behaviors could be a person can talk a person can walk a person can play football a person can play many things that person can do right so these are the behaviors so classes are blueprints that we can use to represent anything in the real world and they are made of two things properties and behaviors then the cool thing with classes is that they are a blueprint right blueprint means just a template which means that then we can create multiple objects so you'll see the term objects being used so objects is the real thing right so the class is the blueprint and then the object is the real thing that is made of based of the class for example we could have a class that represent a person and then i could create one one one object which represents myself and another object that represents you right and we can have thousands of people right thousands of people and those are the actual things right so the the objects but don't worry i'm gonna make sure you understand it let me go ahead and teach you right now right let's create a class that resembles a person and then let's create two different people so here the class is our blueprint as i've said so to create class in python simply type class and here we need to give it a name so here type person and make sure that this p is capital so classes the name it should always start with a capital letter and then here column now inside what we're going to do is have a function and this is very important right so this function is how we instantiate the actual object right so here let's type def for a function so this is a function and then type underscore underscore and then init and then underscore underscore now add parenthesis and type self so self here will refer to the current instance of the current class and you'll see this in a second but here we want to pass two things we want to pass name when we create a person and also age right now add semicolon and now type self dot and then name equals to name and probably this is the most difficult thing that you have done in this course but don't worry you will understand in a second and also type self dot and then h equals 2 and then h this is everything that we need for our class at this point so this class has two properties name and age let's now come out of the class just like that and what we're going to do is create two people so to create a person let's say that we want to create a person called john and then say equals and then person just like that so person is this class here so capital p and then parenthesis now remember because this is a function so this def init is a function and it corresponds to this one we have to pass some arguments here we have two parameters name and age so the name that we want to give to john is actually john just like that and then age let's say that john's is 22 and there you have it now we have the real object so john is an object so this is the real thing now right so from our blueprint we created john let's also create a second person so this will be mariam equals to person and then the name will be mariam and then let's say that my room she's 18. and now if i run this program nothing happens this is because we're not doing anything with these two people right here so here let's just print to the console print and then we want to say john and then we want to get john's age so john dot and then h just like that and let's actually add oh actually just here let's say john first so john dot and then name plus and then single quotes add a space there and in between just like that let's do the same for miriam and here instead of john say mariam and here mariam and there you have it so if i run this you can see that we actually get an error can only concatenate strings not int okay cool so you've seen this before so here what we need to do is say str so we want to convert the actual h to a string just like this so str just like that and then end parenthesis here and if i run this now you can see that we have john and then 22 merriam and then 18. so you have successfully learned how to create a class so the class is the blueprint and then from the blueprint we can create multiple things right so here the thing that we have created is john and this in programming is referred as an object so we have two objects we have john and mariam so the class is the blueprint and then these so line six is one object and line seven is another object so here we actually just defined two properties next let me go ahead and show you how to define behaviors with classes right remember that before i've mentioned that classes are made up of two things they're made of properties which we have right so name age those are two properties and also behaviors so behaviors are the things that a particular class can do right so properties on the other hand are simply attributes like name age date of birth ethnicity so on and so forth so let's create two behaviors for this class right here and then i'm going to show you how to use them so let's create a function so 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 self allows us to get access to the properties that we have so name and age so here add parentheses and inside of this function let's type print and then parentheses and here say self dot and then name plus and then space is walking and then add like three dots for example let's also have another behavior so here death and then speak and then pause self again and then print and inside we're going to 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 plus years and then old and this function just says hello my name is whatever name and i am and then the actual age and then years old and you'll see this in a second so right so now we have two behaviors for our class so this means that now we can go ahead and right after we print the name in here right we can say so let's do for john first so now we can say john dot and then check this out we have speak and walk so speak and remember this is a function and the way that we invoke functions is by adding the set of parentheses just like that and then john dot and then walk and let's do the same for mariam so mariam dot and then and then speak and then invoke the function and finally miriam dot and then work and then invoke the function again and now we are good to go so if i run this and yet again i forgot to add the string conversion on integer so it is fine so and in here remember we have to say str and then the actual h there we go just like this and now let's run it and uh check this out so here we have john and then 22 and then john speaks so hello my name is john and i and then there's we are actually missing a space here so i am 22 years old and then john walks so john is walking and then we have mariam so mariam18 and these here are the actual behaviors so mariam now is speaking so hello my name is maryam and i am 18 years old and then miriam is walking so there you have it so let's actually fix the space so we have to add a space here and let's have i think we can just remove this first print statement here just like that and what i'm going to do is take miriam and i'm going to put it right here so everything is organized just like that and let's have a print and then just have some lines just like that now let's run it one more time and there we go so here you can see that 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 you now know exactly how to create classes how to define properties and behaviors if you have any questions on classes please do let me know otherwise let's move on right it's time for us to put our skills into practice what we're going to do here is to build an application that will ask us a series of questions and upon completion when we answer the questions the application will build a cv that we can use so this will be a really really interesting project for us here so also we're going to incorporate the text to speech capability where the application will talk to us or actually to you and ask you questions so this will be really cool so go ahead and make sure that you are comfortable with the basics if you have any questions go ahead and let us know on the group literally let us know and we will be there to help you without further ado let's go ahead and kick off this cv builder application all right so let's go ahead and build this awesome cv that you can showcase as your portfolio so for this project we need to install a package that will let us write documents so let's go ahead and open up the terminal so what we're going to do is navigate into view and then in here you have terminal in here or you can also see terminal here and then you can say new terminal so both ways do work if i press on that you can see that now we have this terminal right so in here we can type some commands so here this might be a little bit different than yours but whatever we're going to type it should just work if you have installed python correctly so let's go ahead and install the package that allows us to work with documents to do that we're going to type pip and then 3 so pip 3 is the package manager for python and basically we can download existing packages that other developers have written and made available to anyone to use so in our case we want to use this library to give us the ability to write documents and instead of us 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 so to install a package say pip 3 and then install and then the name of the package is python dash and then docs just like that and you can see that this now is going off and downloading the package so now you can see that successfully install python docs 0.8.2 so this is the actual version so if this command doesn't work for you for any reason try and run pip 3 install and then just docs just like that so there are two versions but they are they're both the same package but only if the first command doesn't work for you so now we can close this window and let's go ahead and use this library that we've just installed so to use a library we're going to learn something new which we haven't done before but type from and then docs and then import document so what we're saying here is from the library that we've just installed we're going to import this document right here and the way we use it is as follows so let's create a variable so i'm going to say document equals to and then document and in here we need to invoke this just like that with set of parentheses and you've seen this before so the same that you saw before we had mariam and then equals two and then person and then we passed name right so i think it was mariam and then she was 18. so the exact same thing here but in here we're not passing anything inside so now let me actually remove this and now we need to create the actual document so type document dot and then save and in here we need to pass a string and this will be the name of our cv or document right so here this will be cv dot and then docs just like that now let's go ahead and run this so click on the play button and there we go so this has run successfully but you don't see anything so let's close this and now open up explorer and check this out we have our cv.docs so if you click on it you can see that we can't really open up this because it's not supported by vs code but we could install a plugin but what i'm going to do is actually just open it on my file system so i'm going to close this and then in here what i'm going to do is just close this first and then i'm going to resize my window slightly and then i'm going to open the folder and what i'm going to do is just make this a little bit bigger so just just like that and hopefully i can put it just like this and then let's just try and put it right here so i don't have to keep on opening this every time so there we go just like this and basically we have two files here so we've got the cv as well as our python file which is the one that you see here so now if i open up this cv and check this out we've got an empty cv so this is really cool hopefully you got this far next let's go ahead 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 of vs code what we're going to do is a bunch of things in between the creation of document as well as the saving of document right so we create a document we do some stuff in between and then we save so in here let's go ahead and have a variable that will hold the name phone number and email so let's go ahead and create a variable simply say name equals to nelson and let's also have phone underscore and then number equals two and this will be just zero zero zero for now right and finally let's have email equals two and then hello at amigos code.com so what we're gonna do is take these three variables and then add them to our document or cv so to do that we need to say so in here we need to say document dot and then add and then paragraph just like this and in 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 simply say for now hello i just want you to see that if i run this you can see that worked let me just close this and then open up the document you can see that we have hello right here so let me just zoom this there we go so we have hello so what we want is the actual name phone number and email so what we're going to do is remove this string right here and we're going to say name and then plus and then the quotes and in between let's add this pipe plus and then phone number the same pipe and let me just put this a bit smaller so it fits everything under one line just like that and then another pipe in here and then finally email cool so that's everything that we have to do so if i run the program and it's complaining because i've missed the plus sign so here we need to concatenate this as well and there you have it so now if i run it you can see that it works and if i close it open up the document and you can see that we have nelson right here zero zero and then a low amigos code so what i want really is to take this name phone number and email coming from the console as an input and you've seen it 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 question mark and another space we're going to do the same for phone number so i'm just going to grab this command c paste that in and the same for email but instead of name i'm going to say phone number and then what is your email now if i run the program check this out so at the bottom we can add our name so here i'm going to say for example ebba and then phone number is 0 three just a random phone number and then email will be ebba at and then gmail.com enter and now if i open up the cv there you go you can see that we have ebba and then the phone number so let me just zoom it so you can see everything properly there we go so ever 033 this is the random phone number and then the actual email so there you have it you now know how to take input and then store that in a document so this is just the beginning of your cv but by the end of this section will look super amazing next let's add a profile picture alright to add a picture to your cv go ahead and grab any of the pictures that you might have so if you don't have a picture right now what you can do is navigate to pixels.com and then in here you can search for profile and then picture and then you can just pretty much use one of these pictures so you can download to your local computer and you can follow along 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 so this is our folder where we have our python file so now let me go back and you can see that we have the profile picture here right so what we're going to do is let me close this document and then this as well so just before so in here just before this name variable what we're going to do is add the picture so to add a picture is really straightforward so say document dot and then for paragraph remember here you said add and then paragraph and for picture you say add underscore and then try to guess well you've guessed it right so add and then picture just like that and then inside we have to pass few things one is the name of the file so in my case it's me dot and then png so this is the file extension and you can see right here so me dot png and if i run this you can see that we have to input the name so let's say nelson this time and then phone number zero zero zero hello at and then amigoscode.com enter and now if we open up our cv right here check this out the picture is in our document so this is really cool so one thing that we want to do is the picture is actually too big so what we're gonna do is the following go to the top and then here say from and then docs with x dot and then shared import and then inches so what this will allows us to do is to say after the file name here add a comma and then say width equals two and then inches so this inches right here is this one and then inside of inches oops oh my god right so this is actually on my way so here inside of inches we have to pass a number so in my case i'm going to pass 2.0 and let me put this on a new line so you see properly just like that and there we go so you can see that we have the file name and then we say width and then inches so now if i run this let's again add the name there we go enter and if i open up the document once more you can see that the picture now is much smaller so there you have it our cv is now taking shape next let's go ahead and learn how to add headings where you can have information about yourself all right before we add a section about yourself what i want to do is add a comment or actually two comments so you haven't learned about comments but comments is a way of you organizing your code so that when you look at it it's easy for you to understand so to add a comment you need to add the pound sign here so this pound sign or hash sign right so you can either press command and then forward slash or control forward slash if you want windows so here you get this symbol right here and here we can say profile and then picture so this is just we document things and then in here we have another comment so let's have another comment and this is so we can organize each section and then here we can have name phone number and email details so one thing that you should know about comments is that this doesn't have any effect when you run your code this is only for documenting this file right here so anyone that looks at it they know that what this code is all about so there you have it so now we have two comments here now let's go ahead and after the paragraph let's add yet another comment and then here i'm going to say about and then me and let's go ahead and add a heading so to add a heading say document dot and then add and then try to guess of course you guessed it right so adding and then in here say about and then me and this will be really straightforward so we're going to say about underscore me equals to input and then tell me about your and then self and then question mark and then add a space and what we're going to do is then add a paragraph so we're going to say document dot add and then paragraph and then here inside we need to pass about and then me and it's as simple as that so you could do it this way where you store the variable name in here or we can take this entire thing here we're going to cut it and you can remove the variable and then just put it right inside so it is totally up to you how you prefer to do this so there you go now let's run the program and what's your name and the number our random number hello at amigoscode.com tell me about yourself i love coding and teaching enter now let's open up the cv and check this out so we have about me this is the heading and it's blue and then we have some description obviously we need more information here but we'll do that in a second next let's go ahead and add some work experiences right let's add some work experiences so in here let me go ahead and add a comment and i'm going to say work and then experience and what we're going to do is the following so we want to add a heading so document dot dot and then add heading and here will be work and then x appearance and then we're going to add a paragraph so document dot and then add paragraph and in here this paragraph will be a little bit different so what we want to do is store this paragraph into a variable called p for paragraph and inside add nothing and what we're going to do is to take few things from the input we're going to take the company and then input enter and then company and then space we want the start underscore and then date equals to input and then let's say from and then date and let's change this to from date as well from date and not data date and then here to and then underscore date equals to input and then two and then date and then add a space there as well here and now what we're going to do is the following we're going to use this paragraph in here to add a paragraph so we're going to say p dot and then add run so this is how you add text to existing paragraphs and then here what we want to do is to say company and then plus and then add an empty space and you'll see this in a second and then say dot and then bold so we want this to be in bold equals to true so you've learned about booleans and next what we want to do is to say p dot and then add underscore run and here what we want to add is the from and then date plus and then single quotes and add a dash here and then plus and then two and the score date and finally what we want is to say plus and then here say backslash and then n so this will give us a new line and then at the end we want to say dot and then italic equals to and then true and you'll see this in a second so there we go finally we can capture the experience description so x periods and then underscore details equals 2 and then input and inside what we're gonna do is on a new line here i'm going to say describe your experience and then at and then plus and we have the company and finally what we need to do is to say p dot and then add and then run and we want to have the experience and then details and then run and let's fill this information once more so nelson zero zero zero and then hello at and then amigos code.com and then i love python so tell me by yourself i love python enter and then enter company so here let's say amigos and then code and then from date let's say that this is from like 2000 to 2020. enter and then here describe your experience at amigos code teaching people how to code enter and there we go so now let's open up the cv and that's the previous one let me close that and check this out so you can see that now we have in here so we have our picture this is um name for number email about and then work experience so here this is what we've done we've got the heading work experience and then this is the company amigos code and then 2000 to 2020 and then this is the the this is the actual description so you can see that the cv is actually taking shape now and one thing is as you are doing this together with me if you feel like this title has to be different for you by no means you are free to change because after all this is your project so let me just go back once more and explain what we've done so i just want to show you here so in here we've got the work experience we have the paragraph and then we capture company from date and to date and then here you see that we have company plus and then a space dot bold this is because of this part right here right so this is so if i make this smaller and just put it here so this is the company amigos code here right in bold and then space but on the same line we want to add from date and then to date and you can see here from date and then to date and you can see the dash there so this is the dash and you can see the dash on the cv right and then you can see that we have this backslash n so this backslash n gives us a new line where we put teaching people how to code which is this part right here so experience details and then we say p dot add run and this is why we have it on a new line so if you have questions on any of this please do let me know otherwise next let's learn how to keep on adding more experiences to your cv right so far in our cv we can only add one experience but perhaps you have more than one experience so how do we keep on adding more experiences until we tell the program that we are done and we don't have more experiences well we've learned about while loops before now let's use it so here i'm going to add another comment and i want to say more and then xp reinsers and this should be e experiences and now i'm going to say while and then true so here while true we're going to do something so i'm going to say more and then experiences or actually has and then more experiences with an e and n equals two and then input so we're going to ask the user whether he or she has more experiences so here let me put this on a new line and let me just close this cv here so here i'm going to say do you have more experiences and then question mark yes or and then no just like that so now we have this variable that will contain yes or no so what we want to do is to grab the response so we're going to say if and then we want to lower the response so we're going to say has if and then has more experiences equals to and then yes we want to do something in here so what we want to do is the exact same thing that we've done in here so with work experience so grab everything apart from the heading right so from here so this paragraph and then scroll down all the way to more experiences and actually select everything right so from line 28 so basically don't include the heading right and then all the way down to where we add the details so we're going to grab all of that so copy that and then in here paste that in and what we're going to do is actually indent this so this has to be inside of this if statement right here and to be honest this is everything but we have one issue here right so currently this program will keep on asking us questions forever right but we don't want that so what we want to do is to say right if the answer is not equal to yes we're going to say else right if it's anything but any anything other than yes we're going to break out of the while loop so remember the while loop keeps on looping forever right but by saying else we're going to come out of the loop so here while true right remember well true keep on looping so if the answer is yes we want to ask the same questions otherwise we want to break out of this loop so one more thing is that in here so the user my reply yes like that or yes like that so to make sure that the user replies in the correct order let's take the input and then say dot and then lower or actually lower like that and you've seen this and we have to invoke the function and this is everything so now let's go ahead and run the program so what's your name and then number and then hello at gmail at amigoscode.com and then tell about yourself or actually tell us it should be tell us about yourself uh but it's fine so here let's say i love coding and then enter company let's say amigos let's say into it and then quick books and then enter and then from date let's say since uh 26 oops so let me delete that so 20 and then 16 to 20 and then let's say 19 and then experience social media expert enter and then check this out now we have do you have more experiences yes or no now let's say yes and you can see that we we have enter company right so it's asking me the same question so here i'm going to say amigos and then code and then from 2019 to date so we're going to say present enter and then here enter or actually describe your experience programmer something like that enter and again do you have more experiences yes or no let's say no enter and you can see that the program has finished and if i close this let's open up the cv and check this out so here you can see that we have work experience and then intuit quickbooks the date so from two social media expert amigos code 2019 present and programmer so there you have it you see that the cv is actually taking shape so let me just close this so one thing here that i forgot was two so i think somewhere around here so yeah so we need a space in here and also in here so describe experience details we need a space there so plus and then space just like that and there you have it so congratulations you are building an awesome cv let me show you again and hopefully this is just the beginning next i want to give you an exercise so that you can test your knowledge right as you can see our cv is taking shape and i think this is the perfect time to give you an exercise to see how far you have come in this course now it's time to put your skills into practice so go ahead and build a section where you can showcase the list of skills so maybe one skill is enough but i don't think one skill is enough so let's also have the while loop and then if the user says no more skills then you exit out of it we also want it to be a little bit different so we want to in in bullet points and you can see the code that you should be using to have it as bullet points so just use it and try and build the section with a list of all of your skills what i'm going to do is to try really really hard so give it a try and then i'm going to give you the solution in a second the solution for the exercise that i've set up for you is as follows so we have the skills comment right here to keep things tidy then we have the heading and we've 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 as we did with experiences but here we ask the user has more skills and the question is do you have more skills yes or no if the answer is yes we want to do the exact same thing as we did in here and then finally what i've done in here i've added a footer to our document to add a footer you need to get access to a section right here so we're just getting access to the first section and then we're grabbing the footer from that section and then we're in the paragraph so here we're saying p so the paragraph that comes from the footer paragraph and then here we're just setting the text so cv generated amigos code and into quickbooks course project and this is the solution for the exercise now let me go ahead and run it so you can see an action here what's your name nelson phone number zero zero z oh actually 999 whatever and then hello at amigoscode.com and then here i'm just going to keep things simple but what i'm going to do is in here let me go to google.com obviously and then here we're going to search for lauren and then ipsum and feel free to add information but basically here we can grab some random text so let me just agree to this and we can grab like random text that we can use so here i'm going to grab that and then put it here enter enter the company so here i'm going to say into it and then quickbooks there we go and then from 2017 to 2019 and then experience and i think we are missing a space there so the experience here let's say social and then media and then manager enter do you have more experiences let's say yes and then here amigos and then code and then from date 2019 to 2020 and then let's say python developer and then enter do you have more experiences let's just say no for now and then enter a skill so 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 let's say here for example management enter do you have more skills we're going to say no so n and there we go so now let's check out our cv so if i open up there we go so you can see that our cv looks really really cool so obviously we could have added more text in here so something like that um but obviously you can put some real information but also you can see the skills so this is a bullet point in bullet points and we have our footer so cv generated using amigos code and intro quickbooks course project so there you have it you now have a cv that you can put on your portfolio and this is just the beginning of your journey next i want to show you one last thing which i think you're going to love it right to install this library that can take any text and then convert it into speech let's go ahead and open up the terminal in here so terminal or command line if you're on windows and then new terminal and you've seen this quite a lot so this is where all the output from our program shows up so to install the text to speech library type 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 installs the library and it's as simple as that and then to use it let's go ahead and close this and at the top let's import the library so type import and then pi text to speech or actually pi tts x3 and there we go so this is pretty much everything that we have to do now what we're going to do here is the following right after we import let's go ahead and say pi t ts3 and then dot and then speak so we have a speak method and here let's have the text so within single quotes let's say hello let's run this and see what happens hello and you can see that it said hello so this is really really great so let me close this and what i'm going to do here is the following i'm going to create a function that will wrap this so we don't have to always say pi and then tts x3 so it's it's it's just too much right so we're going to do this we're going to take this and then we're going to have a def and then say speak and then in here we're going to take the text so say text and then inside paste this right and instead of hello we're going to pass the text so just like that and now it means that we can just invoke this function right here and not having to say this pi tts x3 so right after we add our name let's say here speak and then we want to pass hello within quotes so hello and then plus and then name and then plus and then how are you today with question mark and let's run the program now and you can see that it says what is your name so here let me say for example ebba hello ever how are you today and you saw that it said hello eva how are you today so i'm going to cancel out of this because i don't want to complete the cv right now but you see that with this you know you have so many ideas right so for example you might want to take this speak method and then for example ask for the phone number right so let's say you say speak and then you want to take this question and then put it here and then paste that so if i run this once more let me say nelson oops there i wanna write in here so let me say nelson hello nelson how are you today what is your phone number and you can see that now i can put my phone number right so this is really really great and for the email we're not using the speak functionality so there you have it so i just wanted to show you this awesome package because it's quite amazing of how much you can do with programming so this is all for this video let me just close this and i'm gonna press ctrl nc here to kill this program and then close this so this is all for this video if you have any questions on this please do let me know um but yeah so i had fun teaching you this entire project i hope that you also had fun so i think the next thing for us now is to take this project and then make it ready so that we can build a portfolio and that's what we're going to do next all right in order for us to take this project and make it available for other people to see it and maybe they want to download and experiment as well with this project we have to do one thing so here what i'm going to do first is to open up terminal or command line if you want windows new terminal and 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 and run the program so you can see that this is given me an error and it says module not found right and this is because we remove the package so if you were to send this project to a friend of yours they would need to download those two packages manually right and what we want is to make it easy for them to install those packages with one single command so to do that what we're going to do is to use a file called requirements.txt and then we're going to have all of the packages that this application needs and then we just have to run one single command to download the packages specified in that file so open up the explorer tab and then in here let's create a new file and then here name it as requirements dot txt and inside of this package and let me just close this for now inside of this file we want to have the packages that this application depends on so we depend on python oops so python dash and then docs and then equals equals and then the version so the version that we were using was zero point eight point and then ten and we also depend on so and on a new line so pi t t s x and then 3 equals equals 2.90 so make sure you have the exact same thing here as i have now let's save this file and then close it and to test this let's again run the application and you can see that no module name docks fine so what we're going to do is if i close the explorer tab and then here what we're going to do is say at the bottom we're going to say pip nn3 install minus r and then requirements dot txt now press enter and you can see that it it's using the um it's it's used the dependencies inside of requirements.txt to go and download the dependencies so now you can see that if you send this application to someone else all they have to do is just run this command and then that will pull all of those libraries into the project which then means that we can run the application so if i click on play you can see that we have what is your name right here i'm going to say ebba hello how are you today and what is your phone number and you can see that it's working as before so there you have it this was pretty much the last thing that we needed to do with this project next let's take this application and then store it somewhere where you can showcase it as your portfolio right i hope that you've learned a ton by doing this application so now what we're going to do is to take whatever we've built together and you are going to create your very first portfolio so this is when you can showcase it to employers right when you start applying for jobs this is where you will have all of the projects that you do you should store them where i'm about to show you it's a very popular way of people showcasing their work and this is so important to you to give you that boost that you need so i think you deserve it let's go ahead and create the portfolio together all right for building our portfolio we're going to be using this website called github.com and basically this is a website for developers where you can work in collaboration with other developers and you can store all of your code in this website so go ahead and create an account and once you have an account you'll have something like this so in here i've got a list of projects so on the left hand side and these are called repositories right 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 repository name i'm going to say python and dash into it quick and then books project so this could be something shorter for you but for now this will be my name and then also what i want is this repository to be public so anyone on the internet can access this repository so take public and then add a readme in here so i'm going to show you this in a second go ahead and create repository and there we go so this is our repository so it might look like this so now what we're going to do is let's add our python files and images and everything that we have to add so here add file upload files and then we can take all of these files right and then just put it inside so four files we have the cv so this is the actual cv this might be optional and then we have the python file that contain the source code and then my picture and then requirements.txt so now i'm going to commit the changes in here right so you can see the files are here and i'm going to say commit the changes all right so that's done and now you can see that we have a couple of files you can see that we have our cv this is the picture and this is the and this is the python code so if i click on it you can see that if i zoom in you see that this is our python code right so remember we wrote all of this together right so this is now a place where you can showcase your work so now let me actually um go back a little bit or zoom out a little bit and click on the project and here what we're going to do is the following click on this pencil and we're going to change this a little bit so this will be so let me just remove the dashes there we go and what i'm going to do is to open up an issue so click on issue so i'm going to press command and then a new tab or you can right click open link in a new tab and then here new issue and what i've done i went ahead and have a screenshot of the actual cv here so let's take this picture and then put it inside of this comment and all we want is just this link right here copy that close this and now here paste that in and also we want to have some description so here we're going to say um pound sign twice and then installation and then here add back ticks let me just zoom this so you can see everything so bad ticks and then python install r requirements dot txt remember this is how we install the dependencies listed inside of this file so here let's say run and there we go so now if i zoom out a little bit and then scroll down let's commit the changes and now check this out so python into quickbooks project installation run and then this is the command and then this is our cv so there you have it so this is really really nice so this is your portfolio now you can see that this is amigos code forward slash in the project name so you can take this so if i click here actually so you can take this link and then share with someone right whether you are applying for jobs or just showing to your friends or you can send your username so your github username so if i click on mine amigos code so this is the list of all the projects that i have right and if i go to repositories you can see that the one that we've just created python into quickbooks project there you have it you now have a portfolio well then right it was a pleasure teaching you about python you've come a long way and i can tell you that this is just the beginning for you so the next step for you is to check out my other course on python where i go in much more detail about some of the more interesting things that this language has to offer also if you're not part of the amigos code community go ahead and join join both the private facebook group as well as 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 q a where you get to ask me any question that you want so go ahead and fill the google form on the link down below and i will let you know when the q a will take place it was a pleasure teaching you and i can't wait to see how far you're going this journey
Info
Channel: Amigoscode
Views: 37,453
Rating: 4.9650435 out of 5
Keywords: python tutorial, python for beginners, python classes, python crash course, learn python, python, python course, python 2020, python 21, python tutorial for beginners, python basics, python programming, amigoscode, programming, web development, python from scratch, learn python programming, python 3, learn how to code, pycharm python tutorial, python vscode, python vscode setup, intuit quickbooks
Id: mJEpimi_tFo
Channel Id: undefined
Length: 148min 39sec (8919 seconds)
Published: Tue Nov 17 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.