Python Tutorial | Python for Beginners | Python Full Course | Python Crash Course | Intellipaat

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi everyone i welcome you all to the live session on python tutorial for beginners conducted by multiple experts this session is specially for those who wish to learn python from basics to advanced level and make a career in it so before we begin the session make sure to hit the subscribe button and also hit on the bell icon so that you will never miss an update from us on saying that let's see the agenda of today firstly we will begin with introduction to python in that we will tell you what is python why is it so important to learn then after that we will tell you how to get a job as a python developer what are the skills required to become a python developer and also what are the future prospects of a python developer then later on we will see why one has to choose python over other programming languages like r and sas post that we will tell you the top 10 reasons to learn python then later on we will be covering all the basic concepts of python including web scrapping sets and dictionaries and python seaborn tutorial polls that we have covered lots of projects and demo like kovite 19 global prediction using python building rest api in python and lot more so by this time you must have definitely decided to become a python developer right that's why we have covered python developer learning path at the end and also python interview questions and answers so this is the agenda of the video without any further delay let's get started what is python well ladies and gentlemen you need to understand that python is uh you know a very nice programming language to work with at the basic level and if you're thinking okay so what is it used for well what is python exactly and all of these questions flooding your mind right now well let me answer that python is basically an object-oriented language where you know all the data is considered to be individual objects and worked with it so that is what objective basically means and it's a high level programming language where you know we don't use very complex syntax to work with it is easily understandable and provides you know very high readability as well so by high readability what do we mean well high readability make sure that even a non-programmer or a beginner can basically understand a lot of code when looking through a python code well it's as simple as that and python is primarily used for web development application development and much much more we know how much you guys are excited for web development we know how much you guys are uh excited for understanding data science understanding artificial intelligence deep learning machine learning everything in the u.s might already know that python is used for all of these applications right and that there's a reason for that basically python is known to be the world's number one programming language in fact java actually had this bragging right of being called the world's number one programming language and then python came in and pretty much from then on it has remained on the top spot since then so the next question you might have is is python a new language is it an old language because you know if we do have very experienced developers among us who've been working with java all their life c plus plus c sharp or anything even wonder is python a new language well not exactly because python has been in existence since the 1980s you know it's pretty much close to 40 years now python is almost a 40 year old language ladies and gentlemen and the most important thing you need to understand that it gained a lot of momentum it gained it gained huge popularity in the beginning of the 21st century and basically since then as i just mentioned in the previous slide it has been rising and rising and here's the person who created python his name is eurova and rossum and he's an amazing developer you can check out more about him after the session of course and then coming to some quick python facts that you might know or not know well guys do let me know if you know any of these let's consider firefox you know firefox has over 230 000 lines of code which basically calls to the working of firefox and it's all written in python how amazing is that 230 000 lines of code of python for firefox ladies and gentlemen and then coming to microsoft microsoft of course you know they have their own ide they call it as the visual studio code and this is basically used to promote worldwide python development as well and you can get you know pretty much free versions of this and python is open source if you've been wondering so python is again python has been used by the community developed by the community and implemented very well by the community as well and then coming to netflix did you know that netflix actually makes a lot of use of python especially in the field of data science well everything from automatic image recognition it might be a recommendation for all the tv shows in the movies we can watch on netflix and much much more but do understand that netflix uses a lot of python and then coming to uber uber i'm pretty sure everyone knows about it and they actually make use of jupiter notebooks and they make use of ipython to basically share and store all the data with respect to the driver client interaction and all the ratings and all of that and much much more as you can see on your screen some beautiful usage of python right here well on that note let's come to the topic of why one should learn python well the first point that i would actually tell you guys of why you should consider learning python is how simple it is and how beautiful the readability is so what do i mean well here's a simple java code which basically prints the statement hello world you know we've all been in our first stages of programming where the first piece of code we might have printed very well might be the hello world program right so here is how you would do it in java okay so how do we do it in python well look at how elegant how beautiful and how simple it looks ladies and gentlemen and i'm pretty sure if you had to write code and if you had to start out with if you're a beginner you would prefer python for this you know there are no semicolons it is very much readable and even even if you do not know a programming language you can understand that uh print hello world pretty much you know probably equivalence to putting putting out an output which gives out hello world you know you can at least take a guess and understand but then as soon as you look at the java account you might be taken aback you may be like whoa what's happening right and this is one of the most beautiful reasons why i personally prefer python and why we have thousands and thousands of developers who actually prefer python as well coming to the next point i believe it's convenience because again of course this point applies to multiple programming language out there but the specialty of python is that you know since it's basically platform independent you can run it on windows you can run it on a mac os platform you know basically apple's operating system and you can use any of your favorite operating systems you know in fact if you want to run python on a playstation well you can do that as well ladies and gentlemen yes on your playstation windows mac os playstation and many many other operating systems for that node as well so this you know makes it very convenient for the developers for the people who prefer windows and of course for the population who prefer mac os to everything else so understanding this point is very vital at this stage and next is pretty much cross language operations so what do i mean by cross language operations coming to cross language dynamics you need to understand that python can talk and work well with all of the languages that already exist see for example there are languages you know from c java c plus plus we have javascript your language such as rust we have dotnet and we have all of these languages platforms firmware libraries whatever you want to call it and basically python brings all of this together and if you are an expert in javascript and you know you're trying to implement javascript using python yes you can do that can you run some java code using python of course and can you go on to use.net alongside python of course well as you can see where this trend is heading well it is the number one language of choice for a reason and i believe this is one of those reasons so what do you guys think head to the comment section and let me know and of course coming to artificial intelligence well ladies and gentlemen i know you guys might be waiting for this at this point of time hey what about data science what about artificialness what about artificial intelligence and much more well here it is you know you must learn python today because uh python is one of the most preferred language uh in today's world to help achieve artificial intelligence you know so where is artificial intelligence implemented well look around you look at your smartphone everything from siri alexa all the way to google maps amazon i can go on naming thousands of applications of artificial intelligence which has been so subtly integrated into your life you know you have to even understand and contemplate to see if something's ai or not anymore that's how well it's all been implemented so on that note you know there is a 44 enhancement when you put artificial intelligence and help with the current products which are already existing and ai will of course optimize all of the internal operations in an organization by up to 42 ai will help make better decisions and of course ai will help uh you know pretty much optimize all of the external operations which take place and this is a very important point because you can see a 31 increase there and of course uh workers will be free enough to make sure that you know they spend their time their efficiency and much more to actually be creative instead of doing some redundant tasks well now where does python come in well you need to understand that python gives you a very very efficient way to work with data and when you're working with artificial intelligence it is of course in no doubt that you'll be working with a lot of data to ensure that you can handle all of this data with ease python has got us covered and then let's talk about the library ecosystem of python you know python has an extensively huge library system and pretty much we're going to discuss about the libraries uh as well but then at this point of time you need to understand that all these libraries which are pretty much given to the developers the uh the frameworks or whatever it is all of this is helping uh you know us get closer to making artificial intelligence more intelligent if you know what i mean and of course it gives us beautiful visualization tools and uh compared to any other programming language you know there are languages like r as well of course which are on the boom right now python is again another standard when it comes to using visualization tools and again this in my opinion forms a very important reason for you guys to jump on this because as a learner as a developer as a person solving the problem in your company you will require an efficient way to process the data you will require a large ecosystem to require very good visualization tools and at the end of it there is something even more important is community support since uh python is an open source language it is the number one programming language again thousands of people pretty much uh you know start out with python and learn python on a daily basis help each other solve the problems as well in fact we have the intellipath community where we actually cover python as well you know we cover all of the i.t related concepts in depth uh in the community section where we have people from across the world coming in to help each other's problems out so make sure you check out intelliparts community after uh the session ladies and gentlemen and coming to the next point uh python has another strong footing in today's world as you can see from the title it is web development you know python provides us with so many nice frameworks to work with everything from django we have flasks we have pylons and we have web to pi basically all of these are tools to ensure that you know python as a programming language can help in web development you know the introduction i gave you to python said python is used for web development and app development well you can see all of the beautiful libraries that python provides us for web development on your screen right now django is amazing to work with flask again if learned you can create uh you know very beautiful applications using that pylons of course and at the end of the day even web to pi as well well at this point of time you know my goal is not to overwhelm you guys uh telling you all about what python is and what python is offering us well i'm trying to tell you the potential of python ladies and gentlemen and i know that it is amazing as well coming to big data of course the entire world is a big data problem look around you there is terabytes worth of data being generated every single second you know we upload a picture to facebook we upload a picture to instagram uh you know we might sing and put something out on soundcloud or whatever it is you you're putting in a lot of data out there on the internet and it's just not you it's the entire world population a majority of the population who make use of all these apps so when you're looking at that pretty much you know there is a lot lot lot of data being generated and how does python help well as i mentioned python is amazingly easy to work with it is all because of the libraries and all the support it gets see for example from apache foundation we have apache spark and we have tools test das and pydub which basically uh help uh in giving python the access to basically go on to make use of parallel computing with parallel computing you know you can solve big data problems by breaking down a problem into simple sub pieces assign it across multiple computers and you know have these multiple machines multiple nodes as we call it solve the problem for you and you know do it in such a way that there is no strain on one single machine doing it of course and that's not the only reason if you're dividing the load among hundreds of computers across the server thousand computers for example you have that much of power thousand times of power 100 times a power whatever it is to give it to you in the most simple terms ladies and gentlemen so handling big data with python is a breeze and companies are looking out for all of these and they want you as a big data expert there so if you want to become a big data expert you need to understand all of these concepts and to understand all of these concepts you need to first set across a programming language through which you're going to work and use all of these frameworks that come with it and go on to make use of it right so basically that is exactly uh what i'm trying to tell you guys here when you hold in on a particular language such as python you have all of these beautiful frameworks to work with at the same time then coming to data science you know of course i have put in a fire emoji out there to tell you that data science has been on fire all of 21st century data science is pretty much booming right now and in fact guys if you do not know data science is being actively used right now to fight the outbreak of the corona virus which is spread across the world and you know we have an entirely in-depth session covering basically on how machine learning and other technologies can actually be used to help fight the coronav virus or code 19 as it's called as well so make sure you check it out after this session and of course coming to why you should learn python in terms of the data science aspect well again it provides amazing libraries to work with here as well for numerical computation we have these two beautiful uh libraries it's pandas and numpy you know both help an amazing numerical computation and when you're working with a lot of numbers when you're working with data data frames data sets whatever it is these will ensure that the same level of readability is met and that of course you can efficiently handle all the data with ease and then coming to data visualization ladies and gentlemen we have seaborn and matplotlib these two are very famous tools which are basically used to perform data visualization when we are talking about data science when you're talking about python and when you're talking about you know solving most of the data cases of today as well well as i mentioned it before let me strengthen it again python is the number one programming language out there as of now for data science and if you are capable of handling numerical computation and if you can understand and produce very good data visualization methodologies of course you are preferred by all of the top hiring companies out there and this brings us to all the skills that is actually needed when you're working with python when you have to begin working with python or even general aspects of a programming language such as python so the first skill that you will require is object relational mapping or orm as it's called in short basically orm is used to create virtual databases where you know there is a data which cannot be converted into another type or if you want to perform some analysis on a data which is present amongst huge amounts of data while orm is the tool to go to when you're working with python there is sql alchemy and there is django orm which will basically help you achieve this goal and it's as simple as that coming to skill number two skill number two is basically all the front-end technologies that you might be working on in case if you're looking at the web development aspect of python you know it is a must-have that you understand certain tools like html5 it can be uh you know pretty much javascript it can be css three cascading style sheets of course and there are many other things which you might have and need in your arsenal to go on to become a very good web developer if you're working with python as well but then do understand that it is not always the tools which come into the picture you at the end of the day if you're working with front-end technologies by and making use of python at the same time you will be creating a very good user experience for the person who's going to be watching your website and at the end of the day to keep it very structured you know you will have a program manager who will you know overlook all of these and it is going to be a very structured process of how you'll be going through the same as well and of course you will have a scrum master at the end of the day to bring all of these together to ensure that you know when you're working with a website or a web application that everything goes smoothly and as the way that it's initially planned as well so if you're working with front-end technologies and you want to go on to become a web developer using python make sure or to keep all of this in mind and of course coming to the third skill it's basically all the python libraries that you have to know which exists you know everything from requests beautiful soup uh if pie game we have scrappy so so basically from web scraping all the way to building your own games using python python has it all but the most important aspect of python as we've been talking for a while now is python for the use in machine learning python for the use in data science and python to achieve artificial intelligence at the end of the day so there are some amazing uh libraries and frameworks here there's tensorflow kiras there's spark again numpy pytorch mxnet panda psychic learn and many many other python libraries which will basically help you uh to pick up one which you like and what you would work with and at the end of the day what problem are you trying to solve so python will give you a choice of 250 plus libraries where you can pick up one uh become a master in it and pretty much you know go on to have a successful carrier as a python developer at the end of the day because there are experts who are wanted for kira's there are experts who wanted for tensorflow uh there are experts who are wanted for as django developers uh you know pi game for game developers and there is much much more so you need to understand that all of this are trending all these are among the top libraries for any programming language in the world right now and that is how much uh you know python's libraries have all blown up so make sure you jump on this and make the best use out of it the skill number four that you need to know you need to understand is basically version control systems so basically git is among the world's most famous version control system out there and pretty much this will help you not just as a python developer but as a programmer in general because when you're working with git there is a lot of structure process which basically happens uh it ensures that you know there is no confusion when multiple people are working on the file and uh you know for example a file which is already committed and deployed so basically you know when a file has been deployed and committed in a separate branch well let's say we call it the development branch or call it the branch where the data is actually the data which is all live on the website or whatever it is well this data you're not messing up for testing purposes or you're not working on it actively you know which might actually cause real time changes to your website so making use of git will not only help you with python it will help you with all the other programming languages you know by helping you stage your content by helping you track your commits and to ensure that you know if there is modifications needed and modifications done who has done the modifications to what branch at what point of time and you can even leave comments after the modifications done as well so this will keep the entire concept of programming and bring it into a world of structure and give it some foundation where you know there is no confusions there is no anomalies and basically no mix up when there is more than one developer working on something at the same time so this brings us to skill number five skill number five is very important it's artificial intelligence and machine learning you know why do we keep mentioning so much again as i mentioned it is the preferred language for ai and ml it gives you multiple libraries out there you know everything from working with neural networks and working with machine learning working with deep learning and as i've mentioned all the things that follow in these concepts as well for example in neural networks you have convolutional neural networks you have recurrent neural networks you know you have concepts as auto encoders you can perform time series analysis so all these fancy terms and concepts uh you know they might sound fancy and they might sound convoluted at this point of time but they are the foundation of what makes python a beautiful language to work with and basically they are so easy to learn all you need is a structured process all you need is the right hands on the right instructors and pretty much you know the right content to help you master a language such as python and of course this brings us to the sixth skill which is communication this is the most important skill if you're looking to build a very serious career in python well why do i say that because ladies and gentlemen let us be very honest here if you're working for an organization as a python developer there are chances that you will be working in a team and you will not be doing everything solo if that is the case you need to work amongst your team you need to works among multiple other things see for example if you're a web developer or a data scientist for that matter you know you'll be working with the data ingestion team in the morning you can be performing analysis on or writing on neural network models in the afternoon at the end of the day you might be creating very good visualization by using multiple tools out there no matplotlib or whatever it is and you know you can be presenting all this information to a non-technical audience you as a programmer will understand all of these concepts because probably you've been working on it you're trained on it you're certified on it and whatnot when you're explaining all of this to a person who might not know it there lies a small challenge so communication plays a very important key not just when you're becoming a developer in python but then when you're becoming a developer in general ladies and gentlemen so on that note what are some of the key takeaways that you can pretty much you know notice at this point of time the first thing that i can tell you is if you are willing to take up python seriously or if you want to understand why you should pick up python first check if you have the problem solving skills if you have an interest towards solving problems because python at the end of the day can of course be used for recreational programming it can be used uh even for competitive programming as well and most of the time it is basically used when the problem statement comes up and how you can use a programming language to solve that problem so make sure you ask yourself if you have the intent if you have the interest to solve problems and then programming of course since python is a programming language one of the top in the world you need to make sure that your game is up when you're working with programming and when you're working with the language such as python this is very important ladies and gentlemen the next point is communication as i mentioned communication is very important it is key and when you have to check out you know how much there is to learn pretty much i hope you guys are not overwhelmed with all that was shown on your screen because again 250 plus libraries as i mentioned is a lot and you might be wondering do i need to learn all the libraries well no you just need to start uh by being eager by being curious by checking out what python offers what do you like with respect to the language what do you like to do and how can python help you get to your goal it is as simple as this ask yourself these four questions and pretty much you know this will help you to the maximum so on that note let us quickly check out a demo i'll be showing you how elegant it is to work with python by picking up a problem and solving it using machine learning as well so guys the point of this demo is to ensure that you guys uh you know get to understand how easy it is to work with python of course you know we can work on a very complex uh data set when we can work on a very complex demo basically and the point is to not overwhelm you the point here is to ensure that you know you get a clear understanding with uh with respect to python with respect to its usage and you know well all of us basically like you know uh less code to achieve maximum efficiency and to solve the problem right so nobody wants to write ten thousand lines of code if it can be done in say two thousand lines of code and that exactly is your takeaway after going through the demo session ladies and gentlemen so basically we're going to try to predict to see if a person has diabetes or not or check the onset of diabetes basically by making use of machine learning with python even before we begin as i mentioned python and machine learning has been amazing you know you have multiple libraries here you have one amazing library to work with machine learning and that's psychic long psychic learn is pretty much used you know 99 of the time when you're working with machine learning or you have a requirement where there's a problem and you have to solve it so let's go on to understand and check how we can basically make use of machine learning to solve the problem for us so basically let us go on to check what is the accuracy of detecting the presence of diabetes you know diabetes is again a rising concern in my opinion uh you know be the country like india beat a country like usa or let's say anywhere across the world diabetes is a very deadly disease right now pretty much it is the condition where your body cannot uh maintain the blood sugar and this will cause a lot of havoc if you're not diagnosed and if you're not prepared for it or if you've been ignoring it for a while so at the end of the day it is basically your job to ensure to see how you can bring the world of computing and medicine together see medicine is a field where it's thriving on its own and pretty much you know it can do really really well with or without the help of computing let's be honest that is how it was for the last hundred years or so you know the field of medicine has been grown exponentially coming to today's world medicine alongside data science medicine alongside the power of computing it has stepped up the game of medicines to another level and i'm sure over 70 percent of the doctors are gonna agree to this because again to give you another case in 2019 you know pretty much data science helped the doctors figure out the onset of early breast cancer in all the patients and it sort of gave away a probability of 55 or 56 percent of detection ladies and gentlemen we're talking about cancer where one or two percent can be uh you know can add a lot of things to your life and you know it can take away your life as well when you're thinking of numbers at that scale you need to understand a 55 of probability to a patient saying that hey you have malignant cells in your system which might hurt you or you have benign cells you know they are not cancerous they'll not hurt you and all of this giving this hope to a patient and then proving it with respect to validation that in my opinion is very very important usage of computers with the field of medicine ladies and gentlemen so without further ado let's quickly jump in to understand how we can go on to predict diabetes with the help of machine learning and this step one of any programming language the step one of any problem statement is to understand the problem statement and as a problem statement that i have mentioned uh you know we need to go on to see how we can make the computer understand that right that's the point well let's begin well step one is to basically you know import all of the libraries that you'll actually be using so uh it is a common programming practice to all the beginners who might be watching this session that you import all the package that you think you will require at the starting part of it so you don't have to keep doing it at every point of time so step one is pretty much very important where we're importing all the packages such as pandas and numpy for our data handling and numerical computation as i mentioned at the start of the session you know we'll be using seaborn and matplotlib as well to show you some very good visualizations scikit-learn which is a very important part of machine learning as it poses to be one of the top libraries as i mentioned and of course there is a one single line since we're using a google collab out here google collab is basically a python jupyter notebook you basically you know hosted on the cloud so we have another thing we are importing basically uh files uh which will help us upload files and help google collab talk to our data set as well so after importing all of the python libraries we need to go on to actually load the data set so loading the data set is basically the operation of inputting our files we should be using in our case we're going to be using a diabetes prediction dataset so let me quickly go on to import it so basically using file.upload it'll give us a very very easy way to go on to upload these files and as you can see the file has been uploaded and uh you know our data set is there so your question will be what does the data set look like well can you talk to us a little bit about the data set well of course ladies and gentlemen uh you know you have multiple aspects of this data set and as i mentioned at the start of this project basically this data set is a very simple data set it does not require a lot of cleaning your data cleaning forms a very important aspect of uh working with machine learning working with python and this data set is pretty much uh you know a simple one so quickly going through all of the features that we have we have the pregnancies column which basically describes you know if a person has had a pregnancy and if the person has been pregnant before and the number basically indicates how many times the person actually became pregnant and glucose will basically give you the glucose level on what was tested at that point of time blood pressure again as we call it as bp is basically the diastolic blood pressure which was measured at that point of time and again we have skin thickness which is very important to understand the levels of fat again the levels of insulin is basically generated by the human body and it helps regulate sugar levels and you know it can be uh picked up from a serum test as well coming to bmi bmi is basically body mass index and an average of 25 bmi is considered to be a healthy person anything less than that you might be under nourished and anything above that you might be considered obese as well and then we have the diabetes pedigree function which will basically tell you if there was an onset of diabetes in your family because diabetes is something which is hereditary as you might have read on the internet by now so this basically will give us an understanding to see if it ran in your history to see if it ran in the family history before and then coming to age age of course gives the age of the person and the outcome the outcome is to basically check if the person is basically you know predicted to either have diabetes or not one indicates the person is predicted predicted to have diabetes and zero is the outcome where uh we detect that the person has not had diabetes in their life before and then of course coming to a description of the data set let us actually go on to use some concepts of for descriptive statistics here so descriptive statistics is very simple we're going to be analyzing data using statistics you know everything from the account of occurrence of that what is the mean of all the values in the columns what is the standard deviation what is the minimum value of occurrence what is the maximum value of occurrence and of course uh you know you can go on to check the twenty five percent fifty percent and the seventy five percent uh it's called as the iqr interquartile ranges of all the data as well see some data might not make sense let me point out something really quick insulin will never uh be zero in the body bmi can never be zero in the body and you can see that there are minimum values here and as i mentioned you can go on to perform complex analysis to remove all of these values to pretty much you know ensure that they won't hurt your data later well why do i say this because data cleaning is probably the most vital step for a data scientist out there and data cleaning is very very important when it comes to basically you know telling your model to give out accurate results and basically help your model learn better as well just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipaat to know the right answer now let's continue with the session and this of course brings us to step number three step number three is where you'll be splitting your data set into two we call it the testing data set and we call it the training data set why do we do this well uh you know we need to train the model based on some data and later verify it to see if it has learned something or how accurate that it has learned right so basically here uh we make sure that you know we split the data into a training data set we uh basically split the data into a testing data set and we can go on to perform analysis further and the most important thing is that you know you need to go on to distribute it and uh not just basically you know pick up the data hey first 10 columns and the first and rows of these columns let's split into the training remaining let's go to the uh let's go to the testing data set well no we can actually go on to randomize all of this and distribute it uh with respect to the testing data set and the training data assets well this is basically done to ensure we can add some sort of randomness to our testing and our training data sets at the end of the day and ladies and gentlemen welcome to step number four step number four is where all the magic is happening here is where machine learning is coming into the picture so basically we're using uh something called as gst for for performing evaluation to see if a model can learn something and understand something what is gscv you might be asking you know gscv is basically one of the amazing techniques it's called as grit search cross validation and this technique is used to understand what parameter uh you know what parameter can be used best and how you can go on to evaluate what parameter will give you the best results at the end of the day so you might be wondering can i use just body mass index to check if a person has diabetic can i just check out uh you know using blood pressure to see if this person has uh has diabetes or not well uh you know with respect to grid surge cross validation your data since it's being split into the test case and the training case you can basically go on to tell your model to effectively use this uh validation case which is basically the test case against your training case to make sure that you know your model has learned well you can go on to use uh multiple other things as well there's something called a scaffold validation as well with respect to kfor you know your testing data set is broken down into small chunks and basically it is a enfolds times which is uh run across the training data set what i mean by that you know okay is the number of times you want to run your testing data across the training data set well again uh not getting into all the details to basically overwhelm you again to keep it simple here we'll be using cross validation and you know by making use of the gradient uh boosting classifier we can ensure to find and evaluate what are the best parameters and how we can go on to use them to accurately detect the onset of diabetes so let me quickly run this and ladies and gentlemen as you might know note this is the process where you know the machine is actually learning and it's performing analysis to by going through all of the data and this is very important to know that this might take a small amount of time uh i am thinking in my case this might take about two or three minutes so we'll be back as soon as we get the results so as you can see that took about three to five minutes i would say and and pretty much you can see by making use of grid search you know we can get to a number where we can understand the accuracy of learning but then we can go on to improve all of these you know there are concepts such as hyper parameter tuning and everything which i will not explain in detail again uh you know we have we have in-depth videos just to understand hyperparameter tuning we have in-depth blogs as well uh so pretty much you know you can go on to learn and if most of you are beginners or if you're looking as enthusiasts or learners of an intermediate level you might uh you know not go on to understand it completely as well so at the end of the day we have a prediction here and uh the first step you need to do when you have a prediction is basically store the prediction you know we can put it in a variable and store it and after uh pretty much you know storing the prediction what you have to do is you need to see it uh you know just seeing it as numbers will not make sense so let's go on to use uh graphs and let's pretty much plot uh the frequencies against the predicted probabilities and pretty much as you can see on the screen uh the predicted probabilities versus the direct frequency of occurrence and pretty much can help you with the presence of diabetes or not easily as well and here guys there's a quick fact uh you know pretty much that says that you know the human brain can comprehend uh images 3 000 times faster than numbers and you know pretty much i do believe in that concept as well because when i see graphs basically i understand it better and coming to step number six step number six is basically now using different variety of classifiers to understand uh you know what gives you the best result what gives you the most accurate results as well so uh by making use of a gradient boosting classifier you know we've got an 85.2 accuracy what about the concept such as a random forest classifier again these are different methodologies which again come from mask i can learn and pretty much which will help you understand it well uh as you can see on the screen with respect to random forest classification we have a 78 percent of accuracy in detection what about xt boost with respect to xc boost oh we have almost 80 79.6 percent of accuracy in detection this uh might put up a thought in your mind saying hey why are we looking at class of multiple classifiers why can't we use the best one to you know be done with it well ladies and gentlemen with respect to machine learning that is not the case one classifier might not be the best for all the use cases out there so what we try to do is we put in the other classifiers out there you know we make use of five or six in fact more than that seven or eight to basically understand what will give out the best results and what will basically help the machine understand the concept better and give out more accurate results because at the end of the day we're looking out for the most accurate results or we can get our hands on and that is one of the reasons why we go on to use multiple classifiers as well so you might be wondering you know what can we do any further with this project you know what can we can it be built better well of course you know you can perform a lot of data cleaning for that matter and pretty much you can go on to use many other classifiers as well you can use k nearest neighbors algorithm which is basically k n you can use concepts of perceptron you can make use of the concepts of decision trees and many many other methodologies to check their performances see what gives you the better performance and in my opinion uh you know gradient boosting grading random forest and xc boos pretty much gave us high numbers of accuracy for this particular case and i thought it was fitting enough to show you guys this well as you can see it is pretty much very easy to go on to work with machine learning uh with respect to python now let's take a look at the features that will be available in 2021 in python python is very frequently updated so new features are going to be available with every new version and old features are going to be deprecated in every new version so we recommend you take a look at the new feature list in python whenever new version releases so python will will have several features added to it in 2021 so one of those features is bit count then there's a strict zipping and then that's the read-only proxy of dictionaries firstly it's bitcoin so as we know that computers don't really understand the source code that you write to it it's just a large blob of text it's the job of the interpreter or the compiler to convert the code that we write into machine code machine instructions are at their very basic level written in binary binary is a number system which works with either zero or one and it has a binary digit system binary digits in short are called based so if you have here one bit or two bit information you mean there are two binary digits that represent the information both of them could either be zero or one now the bit count function is there so that you can count the number of ones in a binary format of a number or a string or whatever so once that code is getting compiled and the value that you have is compiled what will be the number of bits or ones in the entire string uh don't worry if you don't understand it we'll take a look at that in the hands-on section as well so that you can get a better understanding then comes strict zipping in case you have not heard of the zipping before uh you might not have used python that much because zipping is by far one of the most common things that has happened so zipping basically allows you to create a tuple out of two lists if you have two lists with different values and you want to create tuples of the same indexes you use the zip function strip tripping basically means that if the list that you are providing zip are of different links you will get an error before this what you would have to do is you would have to check them manually and say okay this is not working you have given us different uh different length of list to zip and we can't process this list and then you move ahead but this was a check that you have to do on your own and sometimes you'll forget so in python they have added this new feature in which when you create a dictionary uh you when you create a zipped version of two lists you will have to provide lists of same links if not then you will run into an error and we'll take a look at that as well finally there are the read-only proxies of dictionaries so in dictionary many times we want to create a read-only version of the dictionary now there are ways you can do that but it's difficult to create a read-only version of a dictionary right at the beginning so in order to use it correctly we will have to use the newer versions of python because they come with a feature set that allows us to do that and we'll take a look at that as well so let's get started right from the beginning and let's have a hands-on in which we understand all of this so let's get started now for the hands-on you would have to install python so let me just show you you have to go to this programming python.org website here you can download the newest version of python and if you want to follow along you can do that here this the code you write here is going to be interpreted in python 3.9 and we want to use the latest pre-release version so go to the download section uh click on the operating system that you want to use it for i will be using windows if you are on mac you can use here if you have some other platform like linux you can click here so i go to windows it opens it up and it shows us look into this section which is on the right hand side it's called the free release section the stable releases are the versions that have been checked and all the bugs have been removed that were reported while the software was being developed on the other hand in the pre-release section we might have some bugs but you can try out the new features as well so you can go here in python 3.10.0 before that you would get python 3.8.7 release candidate one uh but we want this to be the one it was released on 7th of december 2020 so not too long ago and you can download the installer here if you want the help file it's available if you want the embeddable package it's available at first choose the architecture correctly install it and you will be good to go i have it installed and running so i'll just show you what it allows us to do right so the first thing that we have to take a look at is something that we refer to as a bit scout so let me just show you so i will create a number and i will save it inside x let's call it 108. take a look at 108 and we have the value embedded in a variable x now if i want to take it look at its binary representation i have to use the function bin this has been available for a long time this is not python's current version as you can see we have one two three four bits so if i want to check how many ones are there all i have to do is type bit count press enter and i get four if you are using some other version as you can see this is python 3.10.083 a3 is the third alpha version if you're using older versions of items with a 3.9 you might run into an error saying numbers don't have a property or a method named x dot bitcount so in that case you would have to upgrade so this is how it happens now if i were to change x to be equal to negative 1 0 8 now if i were to go back take a look at the binary representation it's the same thing but i have a negative uh symbol added at the beginning to show me that it's a negative number if i take a look at the bit count again i get four so the number of binary numbers that are one here is the same there's three zeros that's four ones so that's one way you can do it so how does it work well in a very basic sense the way it works is what you do is you calculate the binary number it returns a string and here what you can do is you can just count the occurrence of one this should return the same thing as you should so in case you're using older versions of python you can just create a function on your own call it bitcount just call it def bit count get a number and here all you have to do is return the binary representation of x and then count one in it right so if i go bitcount108 you get the same thing so if you're using older versions of python and you want to use this feature this is available for you to use it this way all right now let's take a look at zipping uh again for those of you who are unaware of how zips work let me just show you i'll just scroll down a bit create in zip version i need to create two lists i'll call them a is going to contain i'm going to call it small a now i'm going to create few things here i'll call it i'll call them name so john jane jenny and johnny so we have a list i'll create another list this will be called three things we call it the number of uh the percentage that they acquired so let's say 88 44 and 98. so i will only keep three here as of now let me just add one another to show you how this works and 77 so i have two lists a and b i want to create a tuple of these two values these two values these two values and these two values the code i would have to write for this is going to be little cumbersome but since python provides me with the zipping feature all i have to do is pass in a and b and it returns a zip object if i want to create a list of the tuples i can do so as well it's going to be list there you are john has 88 percentages jane has 44 jenny has 98 and johnny has 77 as you can see the corresponding values are being used but suppose instead of b being this i change the size now it's the length of a is 4 length of b 3 and length of b is equals to equal to length of a we are going to get faults but if i try to create a new list of zip and a then i get only three values so that's the thing that you have to understand when you're trying to use zipping one of the values get removed from this so this is how it works but if i want to add be a little strict here i can pass in a parameter in the zipping function and i'll call strict is equals to true now i have passing so argument 2 is shorter than argument 1. so i have both the features earlier this feature was not available and passing straight is equals to 2 was going to raise an error that it doesn't understand what strict means but now if since i have two lists that are of different links if i want to opt in for stricter versions of zipping then i can do so the reason why this was added strict true was because to make it backwards compatible so that other code that used the older syntax in which different lengths would be accommodated for in cases like this they would not want to break the older code but just want to add a new feature and that's the way they choose to go with it in case we were doing this then we would have to just create another function call it strict underscore 6 passing a and b def stri strict zig a and b and then i have to just check if length of a is not equal to length of b then i have to raise an error or something like that so i could do it like this or i can here i have to use the word accept and throw a new exception now that's possible but i won't be doing that so that's how you can do the new zipping for features finally the third thing that we have to do is we take a look at the dictionary so let me just show you how that works first things first i have to create a dictionary now again the same way i did earlier i had two lists i'll create a dictionary out of those so if i pass in predict with a and b i think yeah so because they are of different lengths it's not going to work so let me just take a look at i'll just create a dictionary easily jane had 88 john had 44 percent jenny had 87 and johnny had 28 percent so let me just store it inside this is a dictionary that i have but right now i can change the values if i want to whether knowingly or annoying so for instance instead of john having 44 i can just make it up to be 77 and it works the same now the dictionary has been updated and it could be a problem if you are someone who doesn't want to change that so that's the way you can do that but if you want to extract these things let's take a look at that first so first of all let's take a look at how you can extract the keys so d dot keys and this is how you get for values you just have to type in the dot values and you get the values so these are two different types decrease and dict values so after getting these things if i want to create a read-only proxy of the original dictionary all i can do is just create a new dictionary i'll call it d dot mappings and it's getting me an error because i have to do it on values so let me just do it and then find its mapping not mappings sorry about the net representer this is a mapping proxy so if i want i can just take a look at how much did jane get h88 how much did john get in 77 if i want to delete i can't do it because mapping proxy does not support item duration so i can't delete the items out of it so that's the way this works again these are not worth it for being used in production so we recommend that you don't use them in production just use them where you can just try them out and see if this works so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so coming to the important aspect of this particular video what are the steps that will help you land a job as a python developer guys so i've broken it down to a couple of simple steps and i believe the first important step here is to master the basics of python because i've seen a lot of python developers in my time pretty much uh aiming for jobs at fortune 500 companies and they have a very strong uh foundation of python and i asked around a couple of guys just before i came up with this video and everyone suggests that you need to be really strong with all of the basics of python probably with respect to intermediate components and advanced concepts you can pretty much learn it from a certified organization and get certified with respect to the same but having and uh you know having and mastering the basics is a very important first step which will pretty much help you land the developer job guys and coming to the second most important step here uh which i believe is uh you know knowing all your data structures guys because uh if you've ever interviewed for an i.t job or a job which requires a developer role then pretty much you already realize that they everyone emphasizes a lot on data structures right so data structures people believe it is a very alluring concept you know it just goes around people's head and people think it's very tough well guys it actually isn't uh you just need to understand if your foundation isn't really good you will find a lot of difficulty with respect to data structures and hey it's always good to go back to your roots right so if you're not strong in data structures just head back to your basics learn everything again i mean there's no harm in learning it again learning it right so you need to have the data structures or knowledge and then you need to know that a couple of uh data structures in python we have lists dictionaries and so much more so you need to know how all of these works and just not just knowing how they work but then knowing how you can make use of them efficiently is again the second most important thing uh with respect to making use of data structures using python in my opinion guys so you need to know how you can turn a pseudo code into an algorithm an algorithm into flowchart probably a flowchart into your python code directly and work with your other teams on this as well and step number three this is one of the directions that you can head to is by uh you know learning django and flask well these are very well reputed uh frameworks for web development which support python guys so django on flask are pretty much again being used everywhere it's so subtly integrated that we would actually not know let's say as consumers or non-technical people you know it is not known of what's being used to develop a website or what's going on in the back end right so django and flask are very important modules and i believe they are they're extremely vital frameworks for a python developer to at least know i would recommend you just you know learn the basics of what's going on with respect to django what's going on with respect to flask and see if you can exploit something out of it make a mini project of sorts which you can add to your resume and which will eventually give it a lot of weightage as well right so this is step number three guys step number four so step number four pretty much involves all the majority concepts that you pretty much learned in step number three with respect to django and flask and actually using all of the skills that you mastered from it to perform a couple of web scraping activities from a couple of sites guys well web scraping again there's a lot of jobs with respect to web scraping which again uh which is which is an amusing fact for me because i just thought uh i mean this was a couple of years ago so i thought web scraping was a small thing in this world but no whip scraping has its foot really strong it has a very good hold in the world of i.t and then making sure that you guys uh can get to this step guys you will need a good web development framework and knowledge in this framework right hence step three was an important one well in my personal opinion step five has to be the reason why most of you guys are here or your goal would be something this right to achieve artificial intelligence with respect to machine learning by making use of python right guys there are many frameworks and many libraries out here for python again python sky kit learn tensorflow by torch for neural networks deep learning and machine learning as well i mean there are so many frameworks for python it will take you a really long time to to learn all of these i mean my intention here is to not overwhelm you with all of the concepts that are present here but i do want to inform you that there are opportunities present there and you can exploit it to land a very good job guys so step 5 would be to pretty much familiarize yourself with respect to machine learning using python because probably from 2017 onwards this was the most and this is the most trending thing when someone talks about python it's either deep learning or it's machine learning guys and we already know the end goal of machine learning and deep learning is just to achieve artificial intelligence right so step five again is very important and if you have a certificate that you've worked uh in machine learning using python that's the biggest bonus or let's say or an upgrade you can give to your resume and this will help you on your path to become a python developer guys and uh step six is the next important thing after you work on your machine learning projects is to know that you have to have a couple of projects let's say it can be beginner projects intermediate projects and advanced projects right so you can pretty much go on to build a calculator as you begin a project you know have an intermediate project where you just make a game and then have an advanced project where let's say you're doing some binary classification using machine learning or let's say you're probably making use of recurrent neural networks and so much more so you need to have some sort of project you need some sort of validation because at the end of it in an interview you're just trying to sell yourself right let's say your resume is just two pages so you need to put everything that you've done in these two pages and sell yourself to the interviewer to convince him that you deserve the python job right i mean python jobs uh pay a lot actually in fact to be honest uh compared to other programming jobs i am not biased but i just uh these are just the facts that are present guys and guys stick to the end of the video where we'll be talking about salaries and so much more and you'll get to know the figures of what a python developer earns as well so this important step here is to tell you that you need to work on some projects you need to get your hands dirty with respect to code and then work with it and go with it to pretty much you know land a good python developer job guys so after all of these there are still some skills i would really i mean this is my personal set of skills that i would push for you guys and the first most important thing is effective verbal and visual communication skills guys because when you're working a technical job i've been in situations where uh you know people are trying to explain concepts to a non-technical person let's say in a business meeting or a business review and those people are not understanding what the developer is trying to tell us so basically what happens is you need to dump down your concepts from the world of i.t and probably you need to know you need to have that verbal skill to explain your code to a developer and to explain your code and concept to a non-technical person as well so in my opinion a good verbal skill is always not just a python developer job it's just great to have for any job guys and then the second thing is good team working ability because if you are a hardcore python developer then you'll be writing hundreds or thousands of lines of code every day right uh pretty much you will not be the only one working on an entire project in a fortune 500 company you will have a team you will have a team lead you will be working alongside your peers so you need to coordinate with everyone then you need to have that ability where you know you can work together as a team and then just push all your skills together bring everything into uh one umbrella and then work with it right so good teamworking ability is what i push for guys so and then the third most important thing is you need to have this interest uh you know in collecting and analyzing a lot of data because with respect to python most of the applications are either big data machine learning or neural networks so you need to have this thriving desire to you know delve into data and understand data better guys so that i think is a good uh skill to have and then uh lastly it has to be good problem solving skills because if you're taking the machine learning or the neural network path it's a lot of mathematics and computer science right so you need to have you need to be very good at uh you know calculus as well so i mean not just calculus you won't be using calculus all the time but then hey guys you will require that particular skill and not just calculus not just mathematics good problem solving skills in general guys and then most of the python developers have an educational background which is pretty much from computer science information technologies or they have a major in mathematics statistics and so much more well this is again the requirement from all of the companies hiring a python developer well if you are uh you know not from a computer science background or an i.t background and you still learned how to become a python developer let's say you just picked up our intellipath's certification and you got certified well you still apply for a very good job and then you just you just need the skills well people these days are not checking a lot of education guys they just need the skills that you have and pretty much a good couple of abilities like teamworking abilities communication skills and problem solving skills and if you're good at this and python well you just into the organization right so on that note uh let us quickly check out uh what a python developers resume looks like here is a very uh small sample resume that i picked up so this person has pretty much worked as a junior python developer at this company called as nrg from one year she worked as a python developer at this company called morningstar in san francisco though the description pretty much is delivering projects with one or two days turnaround time or even within hours so you need to have the ability to sit in code and finish a project having a less turnaround time designed and implemented the boot menu in two line displays in three weeks so again that is a very good achievement probably in three weeks for this particular person and then another python ongoing job at makerspace uh you know made over 800 insertions 150 deletions to four central framework repositories in less than three months took a position which combined two roles python developers and scrum master as well scrum master for a team of nine people introduced a new approach to submit or render for layout and ground department i mean this just looks this should give you the overall picture of what a python developer would do right so at the end of it python developer has you need to be good with your time time ability as well guys so how good are you at uh you know maintaining time because uh as you can see there are usually the turnaround time for python developer is less but then this depends on your organization as well but you need to know you need to be good with time you need to be good with code you need to be good with working with the team and that is a very important part of being a python developer guys i mean you can just check out uh pretty much uh you know you can just google it out a python developers resume and you can pretty much go on to read what these people have actually done uh in their course at the particular firms and uh it's staggering to see that the achievements of people can make even as junior python developers or an experienced python developer as well guys just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pad to know the right answer now let's continue with the session so on that note coming to the next concept pretty much you guys will be wondering by now so what are the roles and responsibilities of a python developer right i've broken it down to three important roles and responsibilities in this particular slide and the first one is writing effective and scalable code guys because as a beginner and an intermediate learner you will be learning to just write code it might not be if efficient it might not be scalable but then just working more and more on it doing projects on this getting your hands dirty with code uh the majority part of your time and learning will make sure that your code becomes effective and scalable because uh you know in an organization and a huge organization which you pretty much uh will want a job in uh will have a system which is already scaled right so you need to make sure that the tiny piece of code that you write will work across their spectrum of devices and networks as well and the second most important roles and responsibility uh part is pretty much developing the backend components effectively just as important as developing the front end is with respect to an organization the back end is pretty much neglected or for the common non-technical person uh it is not seen right so it is an abstraction for the common user but they will not know what's going on in the backend but as a python developer you must be very good at developing good solutions for back-end components and handling them very effectively and efficiently as well guys so coming to the third thing it's uh pretty much you know integrating this particular back end with respect to the front end easily so you need to know how you can go about with a merger with respect to all the back end let's say databases uh you know data storage units and so much more and you to bring these together with your front end to integrate this well guys so these three i believe are a very important role for a python developer and there are more as well i mean you can just go on to find many roles and responsibilities of a python developer but i think those three are the most important ones guys so coming to a python developer's job description here is an actual job description from accenture i picked this up from the website indeed.com which is very famous for uh searching and hunting for new jobs and this is their requirement guys they say that they require very strong quantitative and analytical skills and they require two years of experience in data science as well and this includes python r scala julia or sas they require two years of implementing and developing projects in uh you know using ci cd uh pipeline as well so they require the continuous integration continuous delivery pipelines here as well and then they pretty much uh want you to have experience working with get jenkins docker communities cube flow pipelines and so much more again two years experience in data science and using statistical methodologies well this is the job description for a plain python developer guys so look at the look at the concepts that they pretty much ask you you need to know communities you need to know python you need to have worked with data science again you will require uh some experience in machine learning methods familiarity with clustering regression optimization recommendation neural networks and other machine learning methodologies as well well as i've been mentioning machine learning has been a big part in the world of python and then if you're strong in that you can pretty much you know go on to hunt and get a really good job guys so uh here is another uh job description from this one's from bank of america well here they say uh you you need to have exceptional development skills in python on unix knowledge of agile development again these guys needs government kanban and so much more as well solid object-oriented design skills uh oh is object oriented with respect to uh distributed low latency high availability systems you need to have excellent problem solving capabilities analytical skills in a high pressure environment you must have a degree in computer science physics engineering mathematics or analytical degree as well a strong understanding of algorithms and hey data structures see i told you and then a strong understanding of all the design patterns and why there has to be a pattern that needs to be used well this responsibility uh this role and responsibility again is exactly what we discussed a couple of slides ago right you need to give importance to data science you need to have a degree in computer science well again this is debatable if you do not then you can pretty much you know get there because i personally know a couple of electrical engineers who had the interest to pretty much pick up computer science a decade ago and now they are pretty much you know vice presidents of big companies uh working with respect to python working respect to c-sharp and so much more guys so a degree is debatable but then it would be really great if you actually have that if not you will need to work your way up the ladder of development and you need to prove to people that you can pretty much handle uh the development job guys so coming to the next important thing in this particular video is the python developers salary guys so in america in the united states of america the average pay for a python developer is somewhere around 95 000 dollars guys this is american dollars and then throughout the world let's say in india it's about 10 lakh rupees per annum which is again great if you are just starting out or if you're an intermediate developer but then this is just the average pay guy so the pay lasts from somewhere around or six lakhs all the way till uh 15 lakhs per annum for a python developer from a beginner to an intermediate scale i mean if you're an advanced developer then you can pretty much uh you know get a bigger salary here as well but the uh comparing the entire world's average i mean australia europe uh london and so much more the average base pay per year comes down to somewhere around 92 000 it can go as low as 60 000 american dollars and as high as almost 140 000 per year guys so this is really good amount and you can tap into these with all the potential that you guys have and i've seen a couple of comments from learners uh you know you guys are just unstoppable so you can pretty much get here you can get your really quick but then you need to sell yourself well and i believe that having a certification why you should learn python so basically three simple facts are out there first is that it it is ranked third in the index of the popularity for programming languages it is ranked third and a and it tops the list given by ieee spectrum as the number one language to learn so the in terms of popularity as in the number of people who are using different programming languages and there are a lot of programming languages with different company uses so there are different companies who have created their own programming languages as well so people a lot of people work on those programming languages like uh there's a programming language called abaf which is for sap where they do business-based programming and then there is programming language called apex for salesforce then there is c plus plus c java c hash and a lot of different languages which are out there among those it ranks third in the popularity of language which is being used and it ranks number one in the language that you should learn so since it is very easy to learn very easy to interact with easy to use that's why it is it tops the list for being the number one language that you should learn in order to begin your path in the in the programming field if you will and uh again coming back to the point the preferred domains like uh the data science machine learning and artificial intelligence all inside of python and if you talk about it even the web development a lot of companies use django for writing their back end and they're also python that is a python library which is again being used python there will also help you with that so why we mentioned something of data science again and again and again is if you go about uh by the words of harvard business review which is given by harvard which is a extremely prestigious university they they claim that uh the data science is the sexiest job of the 21st century it is the most highest paying uh job for people who are in the ip sector so who are doing technical programming data science is the field which will fetch you the most amount of money and it has the highest average paid salary across the world across all the different uh jobs that you might have so there are business analysts there are let's say for a program developers there is system architecture a lot of different people so in those data scientists are the one who are paid more on an average than the others so that is why learning python is very important if you want to step in the field of data science okay let's move along and talk about the different companies that you will be hiring so if you see these companies on the screen right now facebook google nasa quora amazon reddit uh instagram dropbox netflix netflix is somewhere it's it's an extremely good company if you are interested in data science they do not pick anyone very easily because netflix again the data science department is crazy good in there so these are the dream companies of our almost every programmer who is out there they want to work for the tech giants like google facebook or netflix and going for these uh if you want to land a job in these places python is like a staple that you must have at the back of your hand if you want to apply to these companies and uh and be there as may be as a a very good developer for them then if you if you're looking along those lines you must learn python if you are looking at any of these companies or nasa for that matter because again uses a lot of data science and so that python is very important so with that let's move along and talk about how you should go about your journey of learning python right so uh there will be different stages so the first stage would be where you are jon snow and you know nothing and at that stage it's fine and then you start off with a few basic concepts you learn about a few different things here and there and then you become an intermediate and once you're an intermediate you must be dedicated enough to learn a lot of different things and that is then and where you become to you try to specialize across different things in python as i mentioned before there's a lot of different ways to go about in your career in python and once you reach the stage 2 where you have experimented with a lot of different things a lot of different libraries a lot of different career paths uh what it looks like to get in there once you know what is that something which excites you most let's say if if machine learning algorithms and programming and finding out data insights is something which is that's something that you like then you're looking to look good go inside the field of data science but if you are someone who is uh very good at writing django backend uh then you are looking at someone who wants to go ahead and learn that with respect to that then you can go ahead and follow your passion in there so whatever works for you uh you can go there or or for that matter let's say if you started learning python and you realize that there is some other uh way that you should go about in your career then also i would say that python is a very good place to enter this field so if you want to learn basic programming concepts and if you want to understand how programming is done python is a good step to get inside of it learn various concepts various data structures learn various algorithms through python and then if you feel like okay maybe i'd be someone who is better at working with let's say some bi twos like salesforce or if i'm someone who should pursue some other paths but which will probably have some tool usage or something like that or some other programming language for that matter having those concepts in the bag by learning python because it is very easy to learn having those oops concept in the back will help you learn any other language also very quickly because you understand how programming is being done right so that is uh about this developers map so how we go about in steps would be like to decide first and foremost why do you want to learn python a lot of people have this aspiration that they want to get inside of computer science and they want to do programming they want to do a lot of different things so decide why you want to learn points and if you if it's just a time pass for you is it something that you want to just finish your semester with or is it something that you want to use to build a great career so if you are looking to learn a great career then you want to learn inside and learn various different concepts which are in there so a lot of different basic programming things that you need to understand will be in there which you have to start with once you have that so now you know that okay i want to learn python for let's say data science right or i want to learn python for learning django then in those scenarios you need to understand that you must have great material to study with and what what i mean by a great material is that something that starts from very basic so a lot of different things like if else concepts and uh uh different concepts like which will be there uh which you want to understand inside of python and you have to work with those items like uh dictionaries and lists and or whatever so these concepts you have to get in the bag and first and foremost and then you can maybe branch out of there so find good material study with where you can understand how python works how programming works how you write and structure the code is very important and from there we move on and enroll in an online training program for python so while learning if you understand that okay i'm doing good now it's time for me to step up my game i want to do use python into something where it is more useful so enroll in some online python certification course or any other certification course that you find which aligns with some kind of certification just enroll in there and learn python in and out because doing these will give you the hands-on practice problems and different things which will enable you to learn algorithms and different data science and once you have that in the back read the official python documentation and this step is only recommended like if you are very interested in python you won't get deep inside of it then you need to learn about the official documentation you can go ahead and understand what the company is doing uh sorry what the programming language is doing and you can get into depth of things in there and understand how things are working from there what i want you to do is um once you have python in the back let's say you have an organizing program or if you have just aced python in the bag so you have python the back you understand how python works i'm telling you we're gonna tell you honestly just learning python will not be enough if you want to have a very lucrative career then you have to learn about various different libraries inside of python you have to get uh this is somewhere you have to grind and you have to learn about the various different things and for this you can enroll into our various different data science courses or machine learning courses and ai courses and uh and find out different libraries which are there inside of python like django and et cetera you can actually you should branch out and explore whatever different libraries are out there across different fields which and find the thing that interests you the most right so there's a lot of different fields out there again as i mentioned before in python itself from there you need to branch out and find out what is your passion something of doing what kind of programming uh makes you the happiest so branch out from there and learn about these different libraries which are out there and uh if uh you have a let's say semi-pro programming languages then look into this yeah i i say this again again i'm watching and learning uh through python you need to look at different source codes which are available out there so there's a lot of free uh free open source materials the open source programming programs which are out there present with their source code for python programs just look into it what people are doing how people are programming learn about it and think about your own project problems and then solve those projects um through let's say it might be an artificial intelligence project where you recognize a guy's eye opening or closing or if you want to recognize if that is an apple or an orange it could be anything so you just start learning through these different things and writing python programs for them and just find out what your passion is and uh looking through the programming of different people will help you understand what is the industry standard and how how clever people can be when they want to write codes so there are people who are extremely clever in writing code they will their code will be very efficient uh by efficient i mean two three different things i mean that their big o of n uh which is with respect to the time complexity so uh what is the time complexity that their code is taking so the code will not take that much of a time and then uh like let's say if you want to do one simple thing of let's say going across and reading different elements in array and finding the a match you can do it in different ways right so even if i write if i can do it in various different kinds of ways some ways will require more time than the others and finding that uh way which will take the least amount of time and being that clever being that cheeky you get that when you see a lot of different kinds of codes that people have written and you get a zest of different things and then you start applying it yourself so for that uh it it's very important that you explore different uh uh source codes which i present out there so that you get a zest of things right so for that that is them so next point is what makes a good python developer again any good python developer on any good c plus plus developer or any uh good developer for that matter will have this same skill set they will be the people who are excellent at problem solving these people are excellent at problem solving and and this you are not someone who who has to be it's like not a god given talent like problem solving you get problem solving through practice so you see n number of problems and you understand the n number of solutions so you see let's say n plus one problem you have now n plus solutions that you can combine or mismatch and find out okay this might belong to this kind of problem and this is how it is being solved so having that knack will only come from let's say a lot of practice a lot of work on it and a lot of seeing a lot of different problems so having that problem-solving mindset is very important then if you have the then there is a lot of people who have n number of solutions right so they see a problem they have the solution but having strong technical skills to implement that solutions in a very efficient manner is a whole new department right even in computer science department you will see a lot of different people who are very good at problem solving but they do not have that technical skills or they do not have the knowledge about how it can be done in the most efficient way and attached by their code maybe does not perform up to the level of their solution that they thought of so implementing that solution to the level of the solution that you thought of is also very important when it comes to programming and having strong technical skills can help you with that then you have to have good communication skills this goes across every job description which you find out that strong communication skills is very important that's why it's very important that you communicate across the board because you have you may have a lot of good ideas but you need to communicate that across the people what you have done what you are doing and how it is better from the previous version that has to be communicated and that comes through strong communication skills and finally there is uh this eagerness to learn so it goes without saying as i mentioned before a lot of people learn python and then they have to branch out because there's so many libraries that you have to learn and if you don't have the eagerness to learn these these different libraries then i'd say it's not worth it for you so if you have that eagerness to learn and if you have that knack for programming and if you have that satisfaction of seeing your code run properly then it is something that you should consider building your career in now what next so let's say we are at a stage now where we have let's say done uh then the python course we understand python we have a python certification as well and i started uh seeing all across of various different libraries i know let's say 510 libraries by now so what should i do now the next step would be do many project as many projects as you can so the only thing that will help your resume apart from certifications or publications or a good work experience is your projects especially for them for people who are freshers any job interview that you go you will be grilled on the projects that you have done and do as many good projects as you can because these projects basically by if you ask yourself why would anybody many interviewer ask you about your projects if you have done it so having a project basically gives them a problem statement and how you solve that using your programming language is uh is is a great solution and it gives an insight of how much depth you have in the understanding of the programming language and how good your program sorry probably problem solving skills is it gives you both of that in the same place and they can grill you about a technical aspect of things so that they can understand how much depth uh how much depth you have in the programming language uh fundamentals and uh some of the good projects to start with is uh here uh mentioned on my screen so if you are interested you can go for twitter sentiment analysis using python then there is a hangman game there is you can make a lot of different kinds of game you can make the snake game and different games which are out there which you can start as many projects but as you move along and learn different libraries you make more complex projects make more better projects which will basically help you enhance your resume and land you those better jobs tomorrow first we'll see about python python is an high level interpreted and interactive language that is used in various fields of development so it is also an object oriented and a scripting language that is designed to be highly readable and it uses english keywords frequently whereas other languages uses punctuation and also it has a fewer syntactical construction than other languages so python is a must for any working professional to become a great software engineer especially when they are working in the field of various fields like web development data science machine learning artificial intelligence and big data so the features that makes python unique is easy to code it is a very simple language that anyone can learn very easily and it is also free and open source then it is an object oriented programming language so it supports object oriented style or technique of programming that encapsulates code within objects so it is also python also supports gui applications that can be created and ported to many system calls libraries and windows systems such as windows mfc macintosh and the x window system of unix so it is also a high level programming language it is extensible that you can add low level modules to the python interpreter and the modules enable programmers to add to or customize their tools to be more efficient so this extensible features makes it more unique for the use in various development tasks then it is a portable language and that can run on a wide variety of hardware platforms and has the same interface on all the platforms then comes integrated language so it can integrate various other applications and technologies then python is an interpreted language so python is processed at runtime by the interpreter and you do not need to compile your program before executing it and this is similar to the programming languages such as perl and php also it has a large standard library which makes the development in the various fields such as web development desktop application development software development data science big data machine learning and artificial intelligence and finally it has a large standard library so there are various libraries and packages which helps in the field of web development desktop application development data science big data machine learning and artificial intelligence so these features makes python a very unique programming language for development and it is widely used across the industries and there are top multinational companies who uses python for their development task now moving on to the next part that is our programming language so r is a programming language and software environment used for statistical analysis and graphics representation and reporting so r is freely available and it is an open source programming language so the core of r is an interpreted computer language which allows branching and looping as well as modular programming using functions so r also allows integration with procedures written in the programming languages such as c c plus plus dot net python or fortran languages so there are various features of our programming language so it starts with open source then it is a comprehensive language it has a wide array of packages that is used in the statistical analysis then it has various graphical libraries that are used in data visualization task so the task of data visualization can be handled using our programming very efficiently then it does not need any compiler for compiling its codes it also performs fast calculations and the next feature is integration with other technologies so it can very efficiently integrate with other technologies to develop software application and then cross platform compatibility that is r is platform independent it can run on any hardware or more than one hardware or operating systems so r is a well defined and simple effective programming language which includes conditionals loops and user-defined recursive functions and input output facilities it has an effective data handling and storage facility also r provides a suit of operations for calculations that helps in the analysis and visualizations of the data and r provides various graphical facilities and libraries for data analysis that you already know so as a conclusion r is world's most widely used statistical programming language and it's the number one choice of data scientists statisticians and researchers that who works on data it is supported by a vibrant and talented community of various contributors now we will move on to another programming language that is sas so it stands for statistical analysis software going to the definition or detail sas is a software suit that can mine alter manage and retrieve data from a variety of sources and perform statistical analysis on it and sas provides a graphical point and click user interface for non-technical users so it allows for data to be read from databases and spreadsheets from various statistical analysis so sas is a leader in business analytics through innovative analytics it caters to business intelligence and data management so it gives various software and services for business analytics sas transforms data into insight which can give a fresh person perspective which can give a fresh perspective on business so unlike other bi tools available in the market sas takes an extensive programming approach to data transformation and analysis rather than a pure drag and drop and connect approach this makes it stand out from the crowd as it gives much finer control over data manipulation and sas has a very large number of components customized for specific industries and data analysis tasks also sas is a platform independent programming language which means you can run sas on any operating system either linux or windows now let us look at some of the features of sas so it helps in strong data analysis it is highly flexible it helps in efficient data management support data encryption algorithms support various types of data format so we have sas studio where we can implement the queries or codes of using sas programming for data analytics then finally it has a report output format that we can get now we'll move on to the next part that is fields of usage for these programming languages so talking about python it is widely used for various sectors or various development fields such as web development desktop application development it is used for guis it is used for game development big data analytics data science machine learning and deep learning python has a wide set of libraries used in various development fields so for web development it uses django flash and for gui it uses teak intel for game development it uses pi game and in big data data science machine learning and deep learning uh there are various libraries such as pandas scikit-learn skype numpy tensorflow keras cafe so there are n number of libraries python has to develop various applications just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipaat to know the right answer now let's continue with the session so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills now talking about our programming so it is basically used for data mining data analysis data visualization and it is also used for building predictive models in data science machine learning and the main purpose of using our programming is statistical computing it is mainly used by industries or organizations to analyze the data to visualize the data and draw some meaningful insights from it by using statistical computing so this is the sole purpose of using our programming so it also has a rich set of libraries that helps us in performing various techniques of data mining analysis and visualization now moving on to the next part that is sas programming essays that is statistical analysis software it is used to output the statistical analysis in the form of tables and graphs which is processed from spreadsheets and databases the significant use of sas is in the financial analytics so it offers the full range of statistical functions and also provides the best gui for data analytics application deployment so it is used in advanced analytics data management business intelligence and predictive analytics so sas is preferred over python and r when the organizations need to analyze and visualize their financial data and which needs confidentiality so that is why sas is a very expensive software now we will look at the applications of python r and sas so starting with python programming so it has various applications so amazon twitter flipkart youtube google facebook and there are many more fortune 500 companies who uses python programming for developing their robust softwares so talking about amazon so it uses python for their recommendation engines there are various libraries and packages in python which helps in developing machine learning algorithms that runs the recommendation engine and same is the case with flipkart it uses recommendation engine which again involves the usage of python programming then talking about twitter so it uses python for analyzing and text analysis for the users so same is the case with youtube it analyzes its data of customers and then talking about google so there are various applications of python and google uses python for implementing natural language processing for implementing its text analysis optimizing the search results of the website then same is the case with facebook now moving on to the applications of our programming so here are the companies that is gartner deloitte genpak ford mckinsey and facebook google again then zelando which is again an e-commerce website and paytm so they uses our programming for analyzing and visualizing their business data and implementing machine learning algorithms to make predictive models then coming to sas programming here are the companies that has amazon netflix youtube twitter fractal cognizant hp citibank dell and it also consists of various other fortune 500 companies that is google tesla so these all uses sas programming for their business analytics so there are very few companies who uses sas for their business intelligence tasks and not all companies can afford uh sas programming because it is a very expensive tool to use for their organization now moving on to the next part that is support and community for these programming languages starting with python so it is an open source programming language and it provides no customer service so you have to search for your doubts and queries in google but it has a very large community of python developers who are from various fields such as web development they can be data scientist uh machine learning engineer data analyst big data engineers game developers and many others so it has a very large community that can help you out in solving your queries now moving on to our programming so again it is an open source and free tool and it does not provides any customer service and it has a large community that can help you out to solve your queries your doubts and various are professionals who are expert in our programming and working can help you out in various data analytics tasks that you need to perform now coming to sas so it provides a 24 7 customer service as it is a paid tool and it is a very expensive tool to use so it has a very good customer service so you can clear all your doubts and there is also sas community that can help you out if you are stuck in a particular problem now let us move on to the final part of this video that is job scope for these programming languages starting with python and talking about number of jobs so according to forbes in india there are 15 000 plus job available for python developer in 2020 and in the united states the number of jobs are more than 50 000 so it is a very uh big number and there are a plethora of opportunities for a python developer talking about salary so the average salary in india is seven lakh twenty five thousand and in usa it is one lakh fifteen thousand five hundred dollars then moving on to the our programming so number of jobs for our programming according to indeed.com in india there are 2500 jobs available for our professional in 2020 and in the united states the number of jobs are close to 8 000. the average salary for our professional in india is close to 6 lakh 53 000 per year and in the united states it is close to dollar one lakh five thousand dollars per year now moving on to the next part that is sas programming so number of jobs according to nokri.com in india there are one to four five jobs available for a sas programmer in 2020 and as per the stats from glassdoor for sas programming there are four five one eight openings in the united states and the average salary for sas programmer is close to five lakh forty thousand rupees per year in india and in the united states it is dollar one lakh ten thousand now for choosing a career option if you are into financial analytics then you should go for sas programming and for getting into the field of web development data science big data artificial intelligence machine learning and development of games you should definitely go for python as it is a widely used programming language and it has a plethora of job opportunities with a very good salary so you must go with python now if you want to get into the field of data analytics then you should go with r so you can see over here in the left hand side there is a java code so it prints hello world and at the right hand side you can see a python code that prints hello world so you can see the difference in the length of the code in these two programming languages so python just uses a single line of statement using a print keyword to print hello world and in java you have to make a class and use various methods so python is extremely simple and it is popular due to so while building robust or complex softwares it requires a lot of effort and lengthy codes using other programming languages as compared to python so basically python is popular due to its simplicity so the features that makes it popular is expressive so it it is a very expressive kind of language it is understandable easily understandable and readable then it offers an easy to understand syntax simple setup and has many practical applications in various development processes and the syntax isn't too annoying compared to other programming languages and you can import a bunch of modules which can often make your code much shorter so this is due to its simplicity so the next thing is it is an open source programming language so in simple terms you can freely distribute uh copies of this software and read the software's code make changes to it use pieces of it in new free programs and that you know you can do these things now the next thing is it is open source so in simple terms you can freely distribute copies of this software read the software's source code make changes to it use pieces of it in new free programs and this makes it open source and free for all now the next point is it is object oriented programming language so python supports object oriented features and compared with other programming languages python's class adds classes with a minimum of new syntax and semantics and it is a mixture of the class mechanisms found in c plus plus so python classes provide all the standard features of object oriented programming language except strong in encapsulation which is only one of many features associated with the terms object-oriented now python is also an interpreted language that means interpreter executes the code line by line at a time so when you see an integrated language like python there is no separate compilation and execution steps you just run the program from the source code and this makes debugging in python easy and thus it is very much suitable for beginners so internally uh python converts the source code into an intermediate form that is called bytecodes that you might have heard of and then translates this into the native language of your specific computer and finally runs it so you just need to run your programs and you never have to worry about linking and loading with libraries and so on so this makes it now finally it is also a cross platform language and python can run equally on different platforms such as windows linux unix macintosh and so on a python program written on a macintosh computer will run on a linux system and maybe for others so thus this makes it a portable language so it is a cross-platform language now let's move on to the next part so python is portable and extensible so this feature allows python so python's extensibility feature so python's extensibility features allows us to write our some python code into c or c plus plus language and also we can compile that code in c or c plus plus language and it is also portable and python language is portable which makes it so if you have a python code for windows and if you want to run this code on other platforms such as linux unix and mac then we do not need to change it we can run this code on any platform so this makes it portable and it is very useful for building software applications now we'll move on to the next point that is it is used in web development so python can be used to build server-side web applications and python actually is not used in a web browser but the language executed in the web browsers will be javascript and and then the projects are compiled from python to javascript so the web applications always uses a combination of python as well as javascript to build an application so the combination of both javascript and python are used to build web applications where python is executed on the server side while javascript is downloaded to the client and run by the web browser so there are various frameworks such as pylons django fla flask web that are used for web development so starting with pylons it aims to make web development fast flexible and easy and then now if you talk about django so it is again an open source and free web application framework that is written in python and this framework provides a collection of modules that makes development easier and also it provides the features that helps in rapid development and clean and pragmatic design of code then comes flask which is a micro web framework which is also written in python and it is classified as a micro framework because it does not require particular tools or libraries to execute it also supports extensions that can add application features as if they were implemented in flask itself then is web 2pi and it is also an open source web application framework again written in python programming language and designed to help to reduce tedious web application tasks such as developing web from scratch so this is the use of web to buy so there are various frameworks that gives us the benefit of developing a python web applications rapidly and with efficiency now let's move on to the next part which is python is used in computer graphics and game development so there are also various frameworks that is pi game tkinter wx python jython which is used for computer graphics and give game development so it is also used to python is also used to develop desktop applications uh beautiful guis so it can be made using modules such as pi qt 5 piquity 4 wx python or tkinter also pi qt5 is the most popular option for creating graphical apps with python now the next one is python is used for software testing so it consists of various frameworks that that can be used for uh testing of softwares now there are various frameworks that are used in python for testing and it starts with pi test testify unit test nose and and mises so let's check in detail uh for what type of testing these frameworks are used so starting with pi test it is a testing framework which allows uh us to write test codes using python and you can write code to test anything like database api and even you can check ui if you want so but pi test is mainly being used in the industry to write tests for apis now the next one is testify that is a replacement for python's unit test module and nose so it is modeled after unit test and test written for unit test will will run under testify with a minimum number of adjustments but it has features above and beyond unit test and so basically it is the advanced version of unit test now checking with unit test so unit testing is the first level of software testing where the smallest testable parts of the softwares are tested so this is used to validate that each unit of the software performs as it is designed to do so so the unit test frameworks in python's are like x unit style framework which provides the benefit of checking each and every unit of the software and then comes knows that is a testing framework again and it collects test from the unit test and also supplies a number of helpful functions for writing time test testing for exceptions and other common use cases then comes memises which is also a package for python which helps generate big volumes of fake data for a variety of purposes like uh like using it for testing database or populating a testing database creating beautiful json and xml files so this is the use of the mices so you can see over here that there are various testing frameworks that helps in automated testings and supports easy debugging using python language now let's move on to the next one which is python is used in big data so again there are so uh frameworks like pi spark pi dupe and task which helps in processing big data so basically python and big data are the perfect fit when there is a need for integration between data analysis and web apps or maybe statistical code with the production database so python helps in big data analytics and various python frameworks helps in writing codes for data analysis also python provides advanced support for image and voice data so talking about frameworks so the it is pi spark framework used by big data so first of all talking about apache spark that is an open source and it is one of the most popular big data frameworks that is used for scaling up the task in a cluster so the spark python api exposes the spark programming model to python then comes pi dupe that offers map reduce api for solving complex problems with minimum programming efforts after that comes das which is popularly known as python parallel computing library and through its parallel computing features it allows rapid and efficient scaling of computation and it also provides an easy way to handle large and big data in python with minimum extra effort now let's move on to the next one which is data science so python is widely used in data science so there are various libraries such as matplotlib scikit-learn pandas c-bonds sky-pie numpy and there are thousands of libraries that is used by data science and it mainly deals with data exploration manipulation visualization and descriptive analytics and even creating machine learning algorithm so starting with matplotlib it is a plotting library for the python programming language and its numerical mathematics extension is numpy also it provides an object oriented api for embedding plots into applications using general purpose gui like uh the general purpose gui toolkits like uh they are take peak inter qt or wx python that we already discussed in this previous section of this session now the next one is scikit-learn so the scikit-learn is probably the most useful library for machine learning in python and it is also used by used for data analysis or data visualization in data science now coming to pandas it is again a software library in computer programming and written for python programming language so they are used in python to deal with data analysis and manipulation tasks so to put it in a simpler words pandas help us to organize data and manipulate the data by putting it in a tabular form after that c bond that is used for statistical data visualization and it is a python data visualization library that is based on math project so it provides a high level interface for drawing attractive and informative statistical graphics then comes sky pi that is an open source python library that is used to solve scientific and mathematical problems and it is also built on top of numpy extensions and allows the user to manipulate and visualize the data so the reason for telling all the details about these python frameworks is that you get to know about the specific libraries that are used in specific technologies such as data science machine learning big data artificial intelligence web development game development for getting into these fields as a python developer so that is the sole purpose of discussing about these libraries as well now let's move on to the next part that is machine learning so python supports machine learning software frameworks so basically python helps in implementing machine learning algorithms so here are few of the frameworks to implement machine learning algorithms that are on python and it starts with accord.net so it contains algorithms that perform vision processing and and they are usually used for the task like facial detection image integration and tracking moving objects so after that comes apache spark so it is an open source also general purpose distributed computing engine that is used for processing and analyzing a large amount of data so basically apache spark is written in scala programming and that compiles the program code into byte code for the jvm then the open source for processing of large amounts of data then comes skye pi which is again a library python library used for scientific computation and performing mathematical operations after that cafe which is a deep learning framework developed by uh berkeley vision and it is written in c plus plus and has python and matlab bindings so it is used in uh integration with machine learning and deep learning so we'll go to the next part that is artificial intelligence so artificial intelligence is one of the where python is used extensively to build ai-based software so it does so by using uh various libraries that is tensorflow pandas pytorch numpy keras and there are various other libraries that we come across for building various ai based softwares so starting with tensorflow that is one of the popular libraries of ai so it is a python library and it is used for fast numerical computing and created and released by google so it is a foundation library that can be used to create deep learning models or it can be used by wrapping libraries that simplify the process build on top of the tensorflow framework then comes pandas that is used for data manipulation and visualization tasks after that by torch that is native uh python package and that provides a complete end-to-end research framework mainly used for research in deep learning field after that numpy that is a python package mainly used for scientific computing and then keras that is a powerful and easy to use open source tool for developing and evaluating deep learning models now moving on to the final point of discussion that is carrier opportunities and salaries so we can see various fortune 500 companies such as amazon google youtube facebook twitter and flipkart that are using various ai based technologies machine learning data science big data to enhance their business so amazon uses data science to build their recommendation system google uses nlp deep learning ai machine learning data science for voice recognition system google maps and for search optimization then youtube uses data science to provide their customers a better personalized experience and so on facebook twitter flipkart uses these technologies so all these technologies uses python libraries to implement and to make their product a better version of before so this wide acceptability of python makes it one of the popular language in the industry and due to this the scope the job scope and career opportunities for a python developer is rising day by day and is and it is very high in comparison to other job profiles talking about job profiles so these are the popular job profiles that are posted by the employers in various job portals so starting with python developer then django developer web developer software developer after that data analyst data scientist ml engineer and ai engineer now discussing about the salary of python developer so the average salary in india is rupees 835 k per annum and in u.s it is 1 25 k dollar per annum so it is a very awesome package to start your career with as a python developer what chat bots actually are you know so as a name suggests chat and bot has something to do with a robot imitating a person uh you know while chatting to another person so when we have to break it down into a little bit of simple terminology basically it's a software which is based on artificial intelligence and this software will try to imitate uh humans it'll try to basically you know perform the same actions as us human beings without the person you know having a very good idea if they're talking uh to a human being or an ai if your chatbot is very good if the chatbot which is being implemented is amazing well uh the human can be fooled enough uh to not know if they're talking to a robot or if they're not talking to a human as well and most of the time you wouldn't even require that kind of a complexity because let's say when you're in the amazon case as well you know where is my order or where why is my payment declined or whatever it is you will have a very simple question to which there will exist a straightforward answer right so it's not like amazon's chat bot will start telling you stories about why your payment failed or why your order didn't come or whatever so when it comes to that if it is very subtly implemented if it is very complex in the back end you will not find a difference between it being a robot or it being a human being as well uh you know way back in the 70s and 60s there was a test which was very famously implemented across the world it's called as a touring test uh if you guys didn't know on that make sure you read up on the touring test was amazing uh on how artificial intelligence is such an old concept but it's being used a lot in the 21st century so whenever you think about artificial intelligence ladies and gentlemen the first couple of things that should come into your mind is for example siri of apple alexa off amazon or the google assistant uh these chat bots uh again have been in our lives most of the time right for all the apple users you guys have siri uh for amazon we have alexa and for the android for mobile users we have the google assistant so you might have been using these on a daily basis because i one for sure i use siri a lot and i use google assistant a lot as well and i do know people who use alexa for their home automations and and much much more so when it comes to stuff like this from the simple amazon chatbot all the way till a complex powered uh bot such as siri alexa or google assistant have been helping us daily so uh you know in fact you can ask the google assistant or siri to play any song for you and in fact let's say you're sitting at a restaurant or something you listen to a beautiful song that be that's being played and you just want to find out what song it is instead of going through all the pain of installing the software which will you know listen to the song and tell you what a song it is or you asking the restaurant manager what song it is just pop out your phone say hey siri what song is playing in the background siri or in fact even google assistant will actually analyze the song it'll listen to it and it'll tell you hey this is a song that's being played how simple is that for example you want to set a calendar in white for the next month or let's say you know you have a meeting which you want a reminder for you want to set an alarm so all these manual tasks which you could do basically with one voice command you can get all of it done very simply and i think that's uh the essence of chatbots ladies and gentlemen so again coming to emphasize on why we require chatbots well when you look at it the first thing it's cost and time effective for the companies because developing a chatbot does not take a lot of money and it makes sure that you know it can be done in a quick and rapid way as you'll see in the demo which i'll be showing at the end of the session it will basically validate this point on how time effective it can be when we're working with chatbots because it's pretty simple it's pretty straightforward and at the end of the day even when you're working on an enterprise level uh basically you know you're working at a level where you have a huge organization which requires a chatbot it'll not really cost much to build it as well and of course uh adding on to the last point itself coming to the second point it's cheap development cost when you're working with chatbots you need to understand that there are only certain things at this point of time that we can do with chatbots of course with every passing day when we're talking about technology there and again uh you know thousands and thousands of things which keep coming into the market but with chatbots you can have it respond you can have it uh you know imitate a human to the best of its ability right and with the current power of ai i think the entire world is pretty much just trying to make sure that their chatbots are as human as possible so with cheap development costs there are again a lot of companies which are jumping on the need of chatbots as well so how would it help the companies you might be asking and the best thing it's human resource see if you have a person uh who is responding to live chat which is basically a mundane task right they keep doing it again and again and again so this person as a human resource can probably put into a more effective role this person can be put into a more productive role rather than answering the queries of customers which can easily be done with the help of chatbots right so it's saving time it's saving money and pretty much it it's increasing the productivity of the company as well this is the primary reasons why uh you know thousands of companies across the world today have implemented chatbots and the next point again adds on to the previous point as well so you know since your company is being more productive now with the help of chatbots again you can pretty much give that wow factor to your customers and if it's not the wow factor which is basically what you're looking for you can help your business brand itself through all the social medias out there by showing the world you know what i've implemented artificial intelligence here and you would invite the world you would invite the developers customers or whoever it is to check it out and see if they like them to see what's going on and this again directly translates to you talking to your customers uh in a more customized way and this will probably help your business in the short term as well as the long term as well right so it makes sense so what do you think i mean there are millions of other chatbot cases that we can think of as well for example there are doctor apps and health apps which will basically diagnose any condition that you might have so you can pretty much type in the symptoms and say this is what i'm facing and it'll probably uh give you a very uh vague outcome of saying hey you might have this kind of a condition of course you should consult an actual doctor and not rely on these chatbots at this point of time but then we're getting that who knows probably 10 years from now uh you know the world of medicine can be revolutionized by keeping chatbots very accurate with respect to the field of medicine as well and that's the thing about artificial intelligence right so when you think about it uh the possibilities are actually endless and we have started seeing those endless probabilities in the last 10 or 15 years or so coming to the next point which is chatbot evolution so this is one important concept because when we talk about traditional chatbots so all these traditional chatbots that we've seen all these days basically are system driven so by system driven what it basically means is that they have access to a small amount of data and their responses which basically they know what to reply for when you ask uh for example uh you know if you have to take if you have to take the amazon case again and simplify it to a level where there is a possibility is that the customer might ask two questions the first question is where is my order and the second question uh might be saying you know why is my payment failed so when you have to break it down into simple terms and the bot recognizes what question you might throw at it uh giving the answer to it becomes very simple so that is system driven and automation scripts as i just mentioned if there are a certain number of questions which the the uh business things that you can ask they can program the answers automatically for this as well and this relates to a minimum amount of functionality because the chatbot cannot really think and grow and you know understand from what the customer asks so it already knows the question it basically maps that to an answer and it just gives it gives an answer so it's basically a give and take policy where the bot might not be learning anything and then coming to the current bots of today's world are these implement task level automation so basically with task level automation they know what they're seeing and they can understand the context between the tasks and all of the system requirements that exist so basically if you're asking a question the simple question again saying where my order is or why my payment has failed it'll already have a system context there in place uh saying uh you know what uh this is the question this is the answer give the customer the answer with task level context it will know what task has to be done to arrive at that answer so it's not like take a question find the answer give you the answer so it's take a question analyze and then give you the answer so with current bots that analyze part that exists right now so the communication level is intermediate so probably 7 out of 10 times or 6 out of 10 times you know you will uh not figure out that you're talking to a chatbot so that's how that's how interesting and intimidating it's become right now that it's getting good we're getting there and customer help well current bots basically have been put into a use of for example project support customer service front desk management and much more so if you have to talk about the future bots future bots will have multiple levels of communication which are cross-linked with each other what this means is that at the end of the day when you have when you are talking to a bot uh you can ask the bot to get some tasks done for you you can ask it queries and get questions it can perform analysis for you and much more and all of this coincides to one thing called a service level automation basically which will ensure that all the tasks which are to be done manually all of these can be automated easily as well just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pack to know the right answer now let's continue with the session so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so it understands system level context as a traditional bots it understands uh task level context as the current bots we have in place and the best part is it it will get people context as well so it will understand who you are and it can start uh generating and recognizing patterns uh in between people what people are requesting for why they're requesting for who requested it so out of billions of people across the globe you know if you keep asking and training your future bots on a certain number of questions or you keep asking it something it'll recognize that the question is coming from this particular person so that's how powerful it can actually get and of course uh in the future as well there are multiple concepts such as bot os and masterbots so bot os is basically an operating system which is uh completely revolutionized and revolving around the usage of uh bots for your use as well and master bots are basically uh bots which can you know control uh a certain number of chatbots under them and control some amount of context some amount of functionality uh which are given to them to handle basically so they are the bots which will handle other bots something like these so something like this so again when we have to get a quick vivid comparison i thought it was very vital uh for you guys to understand this about the traditional current and the future bots as well into the answer of how does a chatbot actually work well uh you know there are two types of chat bots when you have to think about it one is something called as rule-based bots and other one is called a self-paced boss and the other one is basically self-paced bots so when you talk about rule-based bots as the name suggest you know there are some rules on which these bots will basically work on you ask a simple question such as where is my order your bot will recognize the word where is and probably order and this is a rule which is programmed in the back end which says when you find all these keywords just give them an answer saying hey your order is here your order is on the way your order is delayed whatever so you know you cannot ask any complex queries to a rule based what because it will not have rules in the back end which will basically help it understand so think about rules if there are like if they are like a book all right so it will basically look into this book for an answer if it can find it it'll tell you or else it cannot so it's as simple as this and most of the time the training of these bots are really simple and you know it is not complex and what this coincides to it basically means that you can ask simple queries get simple answers if you ask complex queries it might fail and now coming to self learning bots self learning bots will make use of concepts such as machine learning it will make use of concepts such as deep learning to basically understand what you're trying to tell the bot it's not like there's a book it'll blindly refer the book and give you an answer so you'll try to understand why you're asking this what you're asking and how best it can think it can give you the answer so this line that i just said this is very important for self learning bots because this is exactly what makes it highly efficient and it'll it is basically a trick to learn and to make and to basically you know fool you into or thinking that it's it's a human being and that of course is very good for us that is what we're looking for here as well but then training a self-learning bot will take a lot of effort because it is a very complex process to uh you know uh think about working with a lot of data it will be terabytes worth of data for a very simple response generation as well so or training it with a lot of data helping it analyze and helping the bot give us an answer based on an analysis rather than a textbook definition is something uh you know which is very complex as well so these two are the basic types of bots which we work with in today's world but then when we have to talk about self-learning bots a bit because again when you're talking about artificial intelligence when you're talking about machine learning there are again two more types of self-learning bots so they're called as a generative bots and retrieval based bots so let me talk about generative bots for a second here and it's going to give you an answer so basically you might be wondering okay so if i ask it any complex query will i get an answer because it's using artificial intelligence well the answer is no because even though it can do word-to-word analysis there are certain limitations here which will not allow it to give you an answer every single time so in that particular case uh you know generative bots actually have the upper hand when you think about retrieval based parts because retrieval based bots are again they have predefined responses so there are so you ask a question it will go somewhere pick up your answer and give it to you so it's content based no so it's context based with context based it knows what you're asking uh but it is it does not know so it does not know how it can improvise its answer to basically give you the best answer out there it knows that it can give you an answer but it doesn't know how it can give you the best answer for that you need generative bots your generative bots will analyze the accuracy it will analyze the likeness of its answer and then it will give it out to you so with self learning bots uh you know these are the basic examples i'll quickly repeat it so with generative bots it it knows and analyzes your answers before giving it out with retrieval based bots there are certain predefined responses where it just picks it up and it learns a little bit on that and then gives it to you with generative boss there's a comprehensive analysis which goes on with every single word uh that you put in and then it learns with retrieval based bots it'll look and hunt for a context and once it finds that context it will go back to the responses which are stored again and then uh you know map those contexts based on responses and give you those answers as well so on that note next uh we'll have to check out something called as the chatbot chart so basically when you're working with a chatbot right so you know there's a good chance if you're either talking to the chatbot we are messenger you're communicating via website or uh you know you're probably using a mobile to talk to siri alexa or all of the chatbots that we discussed so as a human you will be giving it certain inputs and the chatbot will give you an output so whatever inputs you give right so it will go into something called as a chatbot server so the chatbot server will have three important things if you are talking about uh self-learning bots so it will have certain knowledge and this is like the book that it will go on to hunt and it will have rules rules is basically like an index to the book saying this is where you need to look for the answers in the book and then of course it will have machine learning it will have artificial intelligence saying uh hey learn to understand these rules and learn to understand where you can apply these rules to find the context in the knowledge so something like that and to do all of this it needs a lot of data right so there are numerous data sources across the world it can be something as simple as learning from twitter all the way to learning from certain um studies uh which which is like probably you know 35 000 pages long or whatever so everything from simple to complex data sources it might be on the cloud it might be social media or wherever it is your chatbot server will pick up all of these data sources it'll try to understand what knowledge can it learn based on machine learning and what rules it has to apply so that you know it can arrive at this stage where it knows stuff and then it's not important that it has to know stuff what's important is that it has to find a way to convey all of this it knows in a human way imitating a human right so that is again an important thing so basically this is like a one picture one stop solution to understand the basics of how a chatbot would work on that note uh you know we can so on that note we can actually go on to building our own chat bot to do that there are certain things we need to walk through as well and the first uh thing is prerequisites when you're working with python there are two amazing libraries and you know two among let's say thousands of beautiful libraries of python because i'm a huge fan of python for the reason that it has amazing libraries so there are two main things which we will be using to build a chat bot and it's pretty common at obvious as well so we have scikit-learn which is basically used as the machine learning library for python and there is nltk so nltk is again another amazing library as we'll be working uh we'll be walking through step by step to understand what makes an ltk water test it's an amazing natural language toolkit that is what nltk stands for uh and it's it's widely used in today's world to ensure that you know they can make a very good chat bot as well so to give you a quick revision of what nltk is actually used for so this natural language processing this natural language toolkit is actually used to process certain uh language human language data well mostly it's english because you know again english is a widely used language so it is basically used to understand how this chatbot can be built by making it understand the words see for example you will know what an apple is you will know what a ball is you will know what a cat is this is because from your childhood till today you've been taught a for apple b for ball c for cat or whatever it is so you have been programmed over the years to you over the years where uh you know you you know what all of these are but then as soon as your computer sees a cat there's a good chance that unless it has any training it is just a text which is cat it will not understand that it's uh seeing a cat or that the context is a cat so to teach it that context saying whenever i type a cat you think of cats so that aspect is basically where nltk comes into play and to do all of this there are many concepts there's classification there's tokenization there's stemming there's limitation there's parsing and all of this but to get to all of that of course we'll be checking out all of these the first thing you need to do is you need to install an ltk and to install ntk with python there is a very simple command with pip the package manager it's pip install nltk and once you clear this step you have an ltk install and you can work with it so coming to the uh the terms that we have put down their classification so classification when you're working with data basically is where you help the chatbot understand what type of data it can see for example there are certain words uh you know which are used very commonly they're called as top words so you know for example the is that was all of these are stop words which will arrive and you know you you would be using it multiple times in a given sentence right so you know i i might have used the word uh like a hundred times or more than that in this live session as well so you need to understand to classify what words are very commonly used what words are not are very commonly used and more and then tokenization so tokenization is this a process where each of your words are actually broken down into uh events and so tokenization is this process where each of your words are broken down into single entities and these entities are called as tokens tokens are basically the input to the chatbot that you give saying hey you know what this is a word understand what this means and then coming to stemming and parsing we're going to check this out in a bit of detail in a second now so to make your uh bot understand uh text uh the problem here is that you know your machine when you're using machine learning when you're using artificial intelligence deep learning whatever it is it will require some numerical features to work with it will require numbers it will require vectors it will require matrices to work with it does not require strings and with the help of strings it cannot learn so how do we solve this problem well let me tell you with pre-processing how basically the text pre-processing works there are two things one is case conversions and the other thing is tokenization so again before we develop into tokenization case conversion let me repeat why we're doing this so when using machine learning when you're using artificial intelligence your bots or whatever you're building it will require to understand zeros and ones it'll require numbers to understand and it cannot work with text so we need to find ways to convert our text into these numerical features right and hence we're doing the text preprocessing okay so coming back to the methods so there is case conversions and tokenization with case conversion uh you know for example lower cases might mean different and uppercases might mean different let me tell you so when you starting out a sentence you always start with an uppercase but in the middle of the sentence you will not be using any uppercase unless it's like a proper noun and certain reserved keywords right so your computer needs to understand this and basically to do all of these we will be converting everything into one case usually when you're working with uh building a chatbot because when you're thinking about keeping the same case and helping your machine teach it becomes a it becomes a very very very complex process so to keep it very simple we'll have the cases converted so everything in a sentence will either be lower case or everything in a sentence will be uppercase so that's why we need case conversions and when we talk about tokenization as i just said you'll be breaking down uh your sentences your words into a list so that's basically sentence tokenizers and word tokenizers with sentence tokenizers each of your sentences will be broken down into singular entities with respect to word tokenizers each of your words are broken down into structured entities called as tokens and these uh you know form as the input so when we have to talk about how it works in nltk we have something called as the nltk tokenizer and since we're working with the english language out here so there is a pre-trained tokenizer which will already understand what you're typing in and it's basically the pretend punk tokenizer which is present as a part of the nltk library all right so one important thing you need to understand is that your your text might contain a lot of things which is not required for example you know there are a lot of numbers or letters which you might not make sense of or your computer might not sense off so basically we need to remove all of these words and this process is called as removal of noise because this is noise through which it will not help us in any way building our chat bot and then stop words as i just mentioned right so is was and the uh all of these are very common very very common stop words which need to be removed to ensure that you know your chatbot is not confused when it's working with words so stopwatch have been uh removed or they are you know pretty much categorized differently and then stemming and limitization is where things starts getting really nice because you know when you're thinking about stemming so stemming is basically a word which is derived from its stem so let me give you an example of a stem word a stem word may be uh you know learn l e a r n learn so uh when you're talking about stemming these words uh think about the concepts such as learnt learning learned learn so these four words right which basically has something in common which is l e a r n uh you can have l e a r n t l e a r n e d l e a r n i n g learning so learn is common in all of these words so learn becomes a stem word through which you can give context to all of these other words right so that is stemming now talking about lemmatization lemmatization is a little bit different from stemming and here is why here we talk about context rather than the words itself see for example if i tell you good better and best it gives you a positive connotation and it gives you a general meaning of you know something is good right so good also means it's good better means it's good best means it's good so you need to make your computer understand that good better best all have a positive connotation and it means something is good in general so lemmatization all of these lemma concepts that we talk about is basically this giving your context some meaning so i hope i was clear with stemming and lemming stemming is where we use uh these stem words and basically you know derive something out of each words process processing processed all of that with limitization it's basically context based learning uh good better best where you're giving meaning after the words you're checking about and then talking about the input to a chat bot it's of course when it has to learn it needs input right so basically as i just mentioned since it cannot understand strings directly all of these strings are converted into numerics so basically we are doing this by converting text into numerics based on the requirement if they are required they are considered if they're not required they're not considered and you might be wondering why a concept like this call is called as the bag of words you know why why can't you just call it input so it's called bag of words because here we're trying to consider the words which have come in so we we do not care about the order of words which come in so if there is a sentence which says uh you know i like in delhi part uh the said with the bag of words think of it like you're dumping the words in the bag where you do not care about the order you know for example i like intellipath can become in telepath like i you know like in telepath i or whatever order it is so your sentence might not make sense grammatically but all the words are there in a jumbled order so it's like taking these words and putting them in a bag and jumbling them up or you know even just putting it inside without any order that is why it's called as the bag of words and now coming into uh you know how it is basically processed uh let us take a raw input and this raw input is something like a sentence which says you know i do not like chocolates of course there's not there's not a lot of us who do not like chocolate so ladies and gentlemen again let's keep this our session interactive so head to the uh comment section and put in your comments so we can understand and help each other out better here so again coming back to this with respect to raw input it's let's have a sentence which is i do not like chocolates and you want your computer to basically understand i like chocolates part of it so i do not that do not part we do not want it are you getting it so your input is uh i do not like chocolates you want your machine to pick up i like chocolates and this is how it does so i is required so it becomes one do not is not required so do become zero not become zero like is required like is one chocolates is one so whatever word you want to be picked those words are one and whatever words you do not want it to be picked those become zeros right so this is how uh in a very very simple way it's called as vectorization and of course each of these entities will be separated by a comma but then just to keep it more readable for you guys i'm just showing you a general way on how an input can be vectorized and what is the result that we can obtain by converting this a grammatically correct or incorrect sentence for that matter as well into a mathematical vector all right so i hope this is clear and with that we need to check out something called as the tf idf formula so guys again if you know what tf idf is head to the comment section and let us know so what is rtf idf well it's actually an acronym for term frequency and inverse document frequency well a fret naught if you don't know what this means as i'll be explaining all of this so with respect to bag of words that we just discussed right so when you have an input which is a bag of words it'll have a lot of words so basically i told you we are ditching the order and we're just considering a lot of words right so that is the advantage and the disadvantage the advantage is that there are a lot of words the disadvantage is that you know your your bot will not have a lot of information there so there is a difference between uh having a lot of words and helping your bot understand all of these words right so this is where bag of words has a little bit of a downside which can be fixed and it's fixed by uh you know giving it context and making it understand about these words and to do that we have something called as term frequency and inverse document frequency so let's talk about term frequency before uh first basically you know term frequency when we're working about it you need to understand that we need to find out how many times the term is occurring so this might be because of classification we need to understand stop words we need to find out how many times one word is occurring so if you have a sentence which has the word apple like 100 times let's say it's a 10 000 word essay and you've used the word apple hundred times you know it because probably you have used it now to make your computer understand that there is apple there 100 times we need to find out how many times it has occurred divided by how many total terms there are in the document right so this will give you a term frequency saying uh for example you know if you do a hundred by thousand so there is a chance that point one percent of every single time your what apple is occurring so if you have uh like a thousand words which says apple apple apple thousand times and then if you want to search the term frequency of apple what do you think it is so it's gonna be thousand itself right because there is nothing else in that so i'll give you an example again in the next slide you will get a lot of clarity on this as well for now you need to just know that the formula of term frequency where we are trying to find out how many times a term occurs is basically the number of times it appears in a document divided by the total terms in that document as well now if we talk about idf idf is basically inverse document frequency so inverse document frequency is the number of times uh you know that your word has not occurred what is the rarity of words uh that has basically uh occurred in your document as well so for that we'll be using the logarithmic formula it's basically 1 plus log of x by y where x is the number of documents that you have where you're checking this and why is the number of documents where this term occurs so when you do a logarithmic inversion of this number of documents by the number of occurrence of the term you will get the rarity of how many times the term has not occurred there so let's walk through this with an example on the left i have you know kept the formula so that you can refer to it while we calculate on the right so let's say uh right now we have an essay or we have a document which we also call as a corpus so corpus is basically the input document so let's say we have a document which is 500 words and in this 500 words the word call appears 10 times all right so this is a generic document there is 500 words and the word call appears 10 times here so what does the term frequency of this mean so turn frequency again is the number of times the term appears which is 10 divided by the total words which is 500 so 10 by 500 will give a term frequency of 0.02 so for every word that you have written in this document there is a 0.02 times chance uh that you know that you use the word call this is term frequency visualized and then if you have to talk about idf consider this let's say there are there are 10 lakh documents out there and the word call now appears in just 60 000 of these 10 lakh documents right so 10 lakh documents the word call appears in only 60 000 documents of these 10 lakh documents now to find out the inverse document frequency basically as i just mentioned uh we're going to take the 10 lakh which is the number of documents total documents and divide it with the documents where we have the term which we require so idf in this case is becomes 10 lakh divided by 60 000 which gives us a value of 1.22 and now if you have to give context to your machine if you have to tell your machine hey this is the word this is the context this is how many times it occurs there's something called as tf idf weight and this weight is basically the product of term frequency and inverse or document frequency r so as soon as we multiply all of that we'll get a number which is 0.0244 and this number will basically give a context to your machine saying this is the weight of this particular term in these documents and in each of these particular documents as well so your word in every document in total number of documents added together clubbed and after you find the term frequency and the inverse document frequency you will arrive at the weight of it so on that note we have seen all of these theoretically and we need to now check it practically so let me quickly jump on to the practical aspect of how we can go on to check it so here i am making use of google collab google collab is basically a python jupyter notebook which is hosted on their google cloud platform so this is where we will check out a very very simple demo use case of uh you know how we'll go on to work with chatbots by using python here again as we have walked through the theory we'll be making use of nltk and ltk is the natural language toolkit which is a beautiful library to work with when you're thinking about python and of course as always whenever you're working with python it is a common practice that you import all the libraries that you require at the start of it so in this particular case we are importing nltk and numpy because you have to work with numerical computations we're importing random because we'll be randomizing a couple of aspects here and we're importing string so string is basically a library which will help with string processing techniques in python as well so if you are on a native python environment which is different from uh google collab you might have to install all of these before using it to do it instead of import just type pip install pip space install space nltk pip space install space numpy as well so with google collab all of this comes pre-installed and that's the reason all we have to do is we have to just you know import them and it starts working so after importing all of the libraries the first step is to make sure that there is some data through which we can teach the chatbot right so this is where uh we'll have a file a this file or this document is called as a corpus and with this document this is where all the data resides in which your chatbot can understand all right so to do that first we'll be using the file function we'll be using an open function where the file we have uh we'll call it as chatbot the text of course you can call this anything else you want you'll be opening it in the read mode because you're reading it and if there are any errors we're going to ignore those errors for now so after reading this document we'll be converting it to lower case because as i told you case conversion is very vital for data pre-processing and we will download the punk uh part of the tool case because we're working with english language and this is already a pre-trained library that is present right so this is a one-time download that you'll have to do and of course we have something called as word net so wordnet is basically a database which consists of uh relationships in between each of these words all right so uh with wordnet you will have an access to like 200 languages with respect to punk uh it will give you the pre-trained library for english as well and in fact the wordnet is pretty uh it's a pretty old library of data from it it is it is present with us from from the 1980s as well so that's a fun fact for you guys and now uh we spoke about tokenization as well right so we need to tokenize this to be each inputs of words and be inputs of sentences so basically we are using nltk dot sent underscore token to basically convert the sentences uh from the raw data and word underscore tokenize to basically convert words so here sent underscore tokenizes uh the sentence tokenizer word underscore tokenizes basically the word tokenizer all right so again as you can see if you just put your mouse on that uh you know you will basically find out what it is so you can actually go on to the definition of it and find out about it a little bit as well so now to do this we need an input so we haven't yet talked about what input we are doing right so in fact you know let's go to a wikipedia page and give chat bot so there is a wikipedia page called chatbot and this is like a basic uh you know input to our model to train so what we actually do is you know we take everything here just hit ctrl a in fact copy all of this and basically put it to a file uh create a create a file called as uh chatbot dot text and just put all of this there so you know you will have something like this and this is like a text file through which your chat bot can learn something all right it's simple as this after that save it call it whatever you want but then you have to remember the name because you have to input this right so now coming back to the input as soon as i hit play now it's going to say an error because it does not know where my chatbot.text is it's on my desktop and we're running it on the google cloud so let me quickly upload uh the file here chatbot dot text and as soon as as soon as this is uploaded i can run it again and now it sees my uh chatbot dot uh text file it will convert everything to lower case it will download everything that's required it will convert it into sentence tokens it will convert everything into word token so we did all of this by making use of what five six lines of code and it's it's this simple guys just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session and now coming to the next aspect of the same uh step two uh basically here is where we'll be printing an example to see our syntax token and word tokens to see if it has worked right so now as you can see i just hit print and we're trying to just print a sentence token here and we're trying to print a word token here as well so whatever sentence here you can give any sentence for a checking here and then you know you can just paste to see if this uh term this sentence which is the raw input if it is converted into a token or not so as soon as i hit play here again it is obviously converted into sentence tokens and word tokens as well so coming to the next step the next step is basically pre-processing and handling your data so as i said a word net is basically like a dictionary out there with more than 200 languages and where you know it understands your words now uh we discussed about lemmatizer with respect to lemmatizer we give this word certain context right so that's basically what we're doing out here with lemmetization we are giving it context you can think of the example which i just mentioned good better and best uh there as well right so basically step two is all about that and then coming to step number three step number three is basically where you will be programming a greet response see for example uh with any chat bot right beat alexa be it siri be it google assistant whatever it is as soon as you say hi or hey it will not tell you something which is very vague it'll it'll greet you back it will be very nice to you and it will say hey there what's up or uh you know how's it going whatever it is it's like a human conversation so when you say hi to someone they'll not just nod their head 90 percent of the time they'll say hi back to you right so to give it that human touch step three is all about giving greeting inputs and responses so if you give it a response saying hello hi greetings sup what's up hey or whatever it is uh it will give you a response back with hi hey it'll not it's head it'll give you high there hello it'll say i am glad you're talking to me and all of that so you can change these inputs and these responses to whatever you want so basically this is this is not very complex if it sees any of these it will give you a random input of this this is where we required the random function uh that we inputted right so you might be wondering where it's not like you give hello and it tells you hi every single time you can say hello 10 times and it will give you 10 different outputs from this response here so as soon as we run this we are taking the inputs and we're generating random greeting responses and printing to the screen now uh coming to step number four step number four is where we start giving out responses so to give out certain responses so you need to understand that we'll be using the tf idf concepts so i hope you guys remember the term frequency or concept the inverse document frequency there now we have to import all of these right so basically these are all part of scikit-learn it's part of it's part of the concept called as the feature extraction which is based on textual inputs so we're going to import that and you might be seeing the second thing which is being imported here as well so the second thing which is important is something called as cosine similarity so cosine similarity is a part where you will be uh checking out and teaching your chatbot about how to find certain behavior inputs and how to find and understand uh what your difference is and the similarity is in between what the user types and in between what document is present do you understand that so in our case the document is uh the wikipedia article that we took up and the user input might be something where you know it has to learn and map this user input to the document so that is where cosine similarity is used as well of course you know we can discuss the tf idf concept or cosine or similarity in a lot of depth but then i do not want to overwhelm you guys with loads of information here all right so we're trying to keep it simple and as you can see it's just a couple of lines and you know we've almost built a chat bot so after generating these responses we need to write a function uh for concepts such as uh where you know we are thinking of stop words we are pretty much you know removing all these stop words understanding it and we haven't talked about what happens if your chatbot doesn't understand you right so if it sees stop words it knows what what to do if it sees a greeting message it knows it has to greet you back but then if you type random stuff there it has to give you a response right so it cannot stay idle so basically we are trying to print a message you are saying hey i'm sorry i do not understand uh whatever you have typed so with respect to this function it's pretty straightforward it's pretty easy if it doesn't understand something it'll tell you it doesn't understand you and step five yes step five or probably we can call this step six as well so this is the last step where you will be programming the start point and the end point so starting when you run the chat bot instead of greeting it it will probably say hey my name is this i can help you with this and you know i want to quit uh no and and if you want to quit uh you know just type something you know type bye bye or whatever so in fact there's actually a tiny uh mistake here which i will clear which is a spelling mistake which is can i mean come on everyone does spelling mistakes all right now uh so basically uh what i'm trying to tell you guys here is that as soon as your chatbot starts working uh it'll print out this message it'll say chatbot hi my name is samplebot i can help you with chatbots if you need i you could this will be anything else because you know we randomly picked a wikipedia article for chatbot you can pick up anything it doesn't have to be a wikipedia page you can make it learn on a blog of your choice and then give your responses to the questions you ask and then if you want to come out of the loop this is basically working on a while loop where it's constantly waiting for your input if you want to quit you can just type buy and if it sees a buy in the input section it will say thank you or thanks and it will basically quit so as soon as we go ahead and run this uh you know it says uh chatbot my name is samplebot how can i help you you know if you want to quit type by anytime so let's say hi to our chat bot it'll say hey again as i mentioned it is a random response that it is giving to us based on the greeting pool right so i can say hi again and it will say something else apart from here so it says hi there another time let's let me say like hey or something it'll say something else so as you can see it's not giving you the sample uh a response that it is supposed to give so it is generating random responses and it's giving it to you out there now uh let's uh let's just say we want to quit all you have to type is buy and as soon as it says buy it's like okay thank you for talking bye-bye and it's pretty simple like this right so even this we achieved which like with like five or six simple steps in python which is really amazing and uh in fact let's run again uh so in the chatbot article there's this person called as alan turing who is considered to be the father of uh you know intelligent machines so uh let's ask the chatbot uh who is alan during let's see if it can find that out of course the responses will be pretty vague uh you know it will not be very accurate uh you know it says uh there's a stop word which came here as well of course apart from that it gave you the answer it says alan turing was a british scientist and he was a pioneer in computer science see i asked it a question saying who is alan turing it figured out that i'm asking a who question it found out everything about alan turing and it gave me a sentence output there saying alan turing was a british scientist and a pioneer in computer science as well so basically this is this you know you might be expecting like a two-liner three-liner output but our chat bot this simple chat bot is intelligent enough to find this for you and it's amazing so basically you know we didn't write hundreds of lines of code here we probably wrote like 100 lines in total or less than that in fact to build our own chat bot to do this right so it's as important as this and it's as fun as this so we can check out a case where it doesn't understand so if i go on to type some random stuff uh it will say so see i'm sorry i did not understand you so this uh pretty much you know covers all of the cases we checked out greeting uh we've generated a response where it does not understand you and it pretty much analyzes your document and gives you a valid response of whatever is in the document as well so you can type something else as well which is not in the document and it will say i do not know because it has not gone through these words uh in the document there as well right so again pretty simple and i hope this demo was pretty much you know understandable to all of you guys so you know there are many other complex demos which i can use and show with respect to nlp probably by making use of very very complex data and you know by creating like a very nice use case by making use of a very nice user interface by uh using uh tk inter and whatnot but then again to keep it simple so this was what i had in mind so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills now let's take a look at some of the tools that you might need in order to become a web developer the kind of kinds of technologies that you need to know so web development involves the use of many tools and technologies some of these are the first one is django django is by far the most popular one it's currently in its third version it's uh really a really good framework very easy to get started with it's got batteries included so anything that you might need to do in order to create a web application such as database interaction authentication authorization serialization dc realization uh response parsing there are so many things that are needed and django makes it all easy for you it allows you to break up your apps into break up your entire web application or the back end of your web application into smaller applications which can then be used to create separate uh functionalities or separate features so in order to create an authentication system you can create separate applications for authentication and that way you can just plug and play your applications which is quite easy to use then this flask in order to get a higher level of access and control on the code that you write you can use flask flask is a micro framework it only takes care of a few subsets of the thing and the address of the things are left on you for you to figure out class works well with other tools as well in case you wish to introduce your own database access technologies such as an object or object relational mapper or you just want to do the traditional ways by getting the data from the database and converting each row into a domain object you can do that with flask as well and then comes web to buy vertical isn't that popular but it's quite useful in some scenarios especially if you have a really small application or you want to build applications for quick prototyping purposes reptify is a very easy to learn tool web 25 is also quite good for you to use on your personal projects and so on and they can help you out with a lot of things as well so django flask can we have to fire three of the most popular tools that are used in python and are used in web development let's take a look at ethical hacking so what is ethical hacking an ethical hacker tries to break into a system in order to find out security loopholes that need to be fixed it is to be understood that ethical hackers are employed by the company in whose system the hacker tries to break into so you get onboarded into a company on a contract basis they ask you to have three months full access to the systems that they want to check whether or not are hackable or not you can then take a look at the networking schemes you can take a look as pretending as a malicious user you then need to figure out ways that through which you can break into the system if you find a way it should report back to the people who have employed you and those people can then fix those things and you can even help them out into fixing these problems so that would be really useful and that's why ethical hackers ethical hiking is all about that's what ethical hygiene is all about let's take a look at some of the tools now the tools for ethical hacking are not just based in python but python is quite popular in this field because it's very easy to learn and ethical hacking is mostly about networking but you know you know if you know programming then that could be really really helpful the first word is scattering now scapi is a tool that allows people to sniff network packages so packages that are coming in or out of a router or coming in and out of a network scapi can be used to take a look at those packages and if it's interacting with an unsafe network such as you are on a cap you're in a cafe and a person is logged on to the same router in the cafe is used and they are interacting with in non-https websites which means it's not secure and anything that is being sent over the network could be easily intercepted and then and then taken into account so a person who can take a look at the username and password that you're sending over the network would easily hack into your system so that's what's capita then there's glow grip what flowgraph does is that it takes a look at the requests and response coming in and out of a network and it matches the response body with a particular pattern that you're sending it so if you want to get all the requests that have username or password in the request body then you can take a look at that or you if you want all the net network requests that are going to a specific domain and you can take a look at that as well program flow graph allows you to narrow down the request that you're taking a look at then there's subgroup it allows you to take a look at all the subdomains available for a particular domain so if you are working on an example.com and you want to take a look at all the domains that you need you can explore instead of finding out yourself you can use subroot and it'll tell you whether or not mail.example.com or sample.example.com or lms.example.com are these domain names available for a normal user and if ah if they are then how can we use them that's where ethical hyphen tools come into play these are some of the subset of the tools the tools are really large in number and there are a lot of tools available and again we'll take a look at different uh different methodologies and will help help you navigate these tools in an in order to understand how you can learn them so stick with us till the end but till then just let's just take a look at what else we have game development using python so game development is quite a vast view many people get into programming to learning how to build games of their own now game developer uses python to build games which can be played on a variety of platforms such as computers mobile and so on and so forth there are many ways that you can build games on file using python and we'll take a look at some of them now let's take a look at the tools the first one is spy game by game is one of the most easy to use one of most easy to use python gaming frameworks it allows you to build games using some of the most common technologies that you come to use such as sprite sheets and collision detection and it does all of these things for you many of the gaming engines that we will discuss will take care of the physics for you so in case you throw something in the air in a 3d game how does it then get back onto the on to the surface that we have created and what the interaction will be like all of that is taking care of many of the game images pi game does have extensions that allow you to do that so you can take a look at those as well and it makes it really easy for us to understand how to use these gaming tools and these gaming tools are quite easy to use by themselves as well then comes pi opengl so opengl is a graphics library that has been created and is being used by a lot of people to create a lot of different things pi opengl is the python extension and it allows you to write python code in order to create opengl scene graphs objects and enter and monitor their interaction with each other opengl allows us to efficiently render complicated objects on the scene graph or on the screen that we have available and in those screens many games use opengl extensively so in order to create a stellar visuals and great graphics you need to understand how to use opengl and for python users you can use pi opencl for that pi opengl also allows you to write your own opengl scene graph and interpret some of the opengl objects that have been created by other people so it's quite easy for us to use as well so do understand how to use that and try and use that as well then comes tv so in case pi game didn't work out for you you found it to be too complicated or confusing then kiwi is an alternative to that kiwi also does many of the same things that pi game does but it's very easy to understand it's very easy to use it also allows you to create applications for great games that can be used in either the in either of the mobile applications or or the desktop applications or many other places so you can take a look at tv as well if pygame seems to be a little too daunting for you but i would recommend that you check out all of these tools get a feel for which one serves your needs the best and then use that and now let's take a look at data scientists so data science and a data scientist takes a lot of data and gets useful and in useful insights out of the data or what they do is they take the data and trade a model which can make prediction by learning from the data so data science has elements of machine learning as well data science is part of machine learning and a part of broader range of artificial intelligence which takes a look at the data and figures out what we can extract out of it in order to get better predictions take a look at some of the tools that are available for us as data scientists we have data scientists and data scientists we have many tools available these are a few subsets of them the first one is pandas finders is a tool that if you have worked with data science for any number of time it's a tool that allows you to take a look at structured data so if you have data saved in a csv file in an excel file in an excel worksheet if you have data stored in a database file you can get it into your python program using using python by using pandas and then you can visualize the data you can perform data writing tasks you can group the data sort the data drop some of the columns get some of the data clean the data there's a lot you can do with this especially the cleaning part and the cleaning the data dropping columns all of this is done ridiculously fast in spandex it is very performance optimized so it's very useful in that regard as well then comes numpy numpy is by far one of the most popular languages out there so numpy is you used to numpy is one of the most popular libraries out there numpy is used for numerical manipulation so if you are someone who's getting into the crux of data science and you're trying to come up with algorithms and you're creating a lot of simple equations but you want them to run as fast as possible in python using numpy is quite a good thing because in python the normal data types that we use store a lot of unnecessary information that are not that useful for generic computation numpy strips them out and allows you to perform these computations quite easily it has a lot of convenience functions as well that allows you to just lean over the initial complexities and then figure out how to apply these functions on the data that you have it has sign it has functions to calculate the sign and cosine values and do matrix multiplications transformations fourier transform so on and so forth so any data complicated task a numerically complicated task numpy can perform really then there's psychic learn scikit-learn is by far one of the most easy to learn libraries and what it does is that it takes care of the initial hurdles of learning how to create create a machine learning model or a data science model by learning the algorithms so instead of having you implement all the algorithms cycling takes care of that it contains a lot of generic algorithms that have been developed by people who are working as data scientists for a long time so what they do is that they take the data they convert it and then defend it back to the users so in case you wish to become a data scientist and you want to take a look at psychic line you can take a look at that as well in cycad land you take a lot of you know take a lot of packages that circuit lands provide and in those there are packages for accuracy testing training testing and splitting the data uh cleaning the data or or if you want to build a model you can just import a generic class that can take in the data import them or take in the data train the model and then allows you to make the predictions and those could be saved to be used or exposed later on as well so these are the three to three libraries that are incredibly useful in data sciences python there are other others available as well but these are the ones that are the most useful ones just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pack to know the right answer now let's continue with the session let us quickly walk you through the procedure of how you can install python on windows case it's a very simple and a straightforward process now i've broken it down to a couple of steps and let's go with it together right so step one says go to python.org and head to the downloads page and let's do that side by side yes so let me head to the python website so it's python.org for the people who are wondering uh i'll just go to download here you can directly directly click on the link there as well since we're looking for windows python pretty much detects that it's for windows so we already are at the page where we hit the download so this pretty much forms our second step as well so let me quickly uh you know save it in the desktop it's about 25 mb if i think yeah it's about 25.2 megabytes this will take a couple of seconds to uh download and uh in the meantime let's quickly check out what are the next steps in our powerpoint slide guys so uh step two is again click on the download which we just did and guys as of this video being made python 3.8.0 is the latest stable version out there so that brings us to step three guys step three will pretty much be opening the installer and we should be presented with the screen so let's quickly wait for the download to complete and then we're gonna open up the installation box hey guys uh that took about a minute to install and we're presented with this screen which is the installation screen just before you hit uh install now you can pretty much choose to customize the installation and uh you know install it at a place of your desire make sure you just click this uh button which says add python 3.8 to path well what it basically does is uh it sets your environment variables and it sets the path variable to python so as soon as you hit python in your command line you can just start using python directly guys so that's what it does and it would be recommended that you do this even if you would not do this there would be no problem there are other ways to launch python and to use it but if you are a beginner if you just want to hit python and then start up with coding you can pretty much hit the python to path guys and you just hit install now and this will ask me uh for my admin password because we have to install it as an administrator so let me uh quickly type in my administrator password and we can work with it guys and i just entered my password so pretty much uh it should take about uh i say around two or three minutes to get the entire setup process done ops in the meantime let's check out what's step four again step four is check the last option to add it to the path and install and step five uh is the important step guys so we need to verify that our installation has been successful so for that to occur we need to make sure our setup completes so let's just wait a minute and then we can go ahead with the setup guys so guys now the uh setup is successful let me quickly open up command prompt to verify that it has been installed correctly guys so if i go ahead and type in python there then pretty much python console is ready for us uh so let's type in a sample code hello world and as soon as i go ahead and run this we have the output guys so pretty much well as of this moment python 3.8.0 is the official stable release of python and that's what we've been using guys so we can check out another code snippet as well guys so let me do a equal to 1 be equal to 2 c equal to 3 so much more right up so let us uh create a new variable d and then probably add a and b to it so let me just quickly do this we can print d well d is three let's uh multiply you know let's let's create another variable call it e multiply uh d and c let us print e guys i'm just doing this to just show you that everything is working fine so three multiplied with three is three and so much more to just get out of the console you will have to type quit uh followed by parentheses and you're out of there guys so this is as simple as installing python on your windows guys and we just verified it using a simple piece of code as well guys but python has another thing called as idle guys so idle is this pretty much interactive uh python console that you can go about using and the shell is actually ready so we can go about uh typing again uh hello learners and done so the python 3.8.0 works perfectly on the idle shell as well so this is another way uh to just verify the installation guys so coming back to the presentation step seven is again an optional step but you will get there uh very soon in case even if you're a beginner or an advanced learner guys so install the uh libraries that you pretty much want there are many libraries that python supports and the most popular ones are tensorflow numpy skype sky kit learn pandas matplotlib keras pytorch light gbm and so much more well these are machine learning deep learning oriented libraries that are present on your screen but then the next step of installing python is to pretty much install all of the packages and libraries that you want to go uh or work with uh further on guys now we have python variables so this is the first thing that we are going to learn about when it comes to python so what are variables let's take a look at a variable is simply a container it contains some value in memory a variable points to a memory location where the value that you want to store is stored so in python the data types will be identified according to the data we provide and i'll show you what that means in a moment a variable should start with a letter or an underscore and cannot start with numbers so there are two ways of assigning a variable you can assign a single value and you can assign a multiple value so before we begin let me just show you what you can do and how you can execute some python now since i'm showing you some really common tasks i'll be doing it in the shell now shell is not the way to write code when you're writing code for large applications but when you're trying out small things and you're trying to understand how these things work what it will be the output of one command or the other command shell is a great environment to work in so i'll show you how i do it so i go to the start button i type python and it opens python 3.7 so i open this and it's here so now let me just show you what i mean so the first bit of code that i would like you to write is you should let me just uh make a change to this so that you could see it properly so the font size i'm going to increase it to 28 so that you could see it properly and click ok hopefully it's visible so what i'm going to do now is now i can type any code that i want to write so i will type p r i t print print is a function that will take in something that i want to print on the console a function always gets called with these parentheses opening and closing and two ports inside it we're going to write hello world hopefully you're writing it with me and once you're done with this press enter and as you can see it got printed on the screen now why did we have to put quotations here why did we have to put the curly the parenthesis there we'll discuss all of that in a future video but note that you've written your first line of python code and it was really easy you only needed to write one line of code and it did something so many languages required to line like 15 or 16 lines of code for it to just print something on the console but here we were able to do it with just one line this is one of the major advantages of using python now we come to data types so as we have already discussed in python variables the data type will be identified according to the data that we provide so what exactly is a data type well data type is basically something that allows us to understand what kind of data are we storing in a variable let's say that i want to create a variable named name and i want to store some name let's say the name is john now i want to check what data type it is press type name so it's a class of type string so it's a string a string is nothing but just some characters strung along so it could be a sentence paragraph basically any text that you need to store you store it in a string if you want to store it one continuous long line of text you do it using string now that is done there are many other kinds of data types as well let's say that you want to store a whole number a number which has no fractional point you use integer for that to give an example let's say num is equals to 1 as you can see one has no fractional part width it's a whole number and i press enter and if i look at the type of num i get integer so integers store numbers with no fractional part on the other hand if i want to store some fractional part let's say 1.5 and i check the type of num now it will be changed from integer to float float is something that stores fractional parts so if you wanted to store the value of pi you would store it in the type float now you don't have to define what kind of type you will be using because python takes care of it for you this is what is known as duct typing duct typing basically means that python takes a look at the class and performs the functions accordingly so if you take a look at the value that you are pointing to and it will take a look at it and understand that okay it's a number which is floating point so we can just use it uh so we can just assign a float class to it now the main question is why do we need to use different kinds of data types well there are many reasons the first and the form and the most important reason would be that types are important for us to distinguish between different kinds of data so we can for instance add two numbers so one plus one will give us two if the computer does not know what kind of data it is and it tries to add it it will have no idea how to perform it so let's say that i gave it instead of one plus one i gave it b plus c so what do you think will happen in this scenario if you want to take a guess pause the video for a moment think what's going to happen and then resume it so what's going to happen is it's going to concatenate this tree as you can see it just took b and added the next string to it i could even make it a little bigger b let me just do it this way bsba and css and as you can see that it added it to the uh it added those two three strings together now if this was not a not string and if i were to use a number again what do you think will happen we get an error so this is where we use it because adding a string and a number let's say that you were giving an exam and they say add a plus 15 that would make no sense and the computer will have no idea how to process it it won't have an any understanding of whether it should add two numbers whether it should convert it to string whether it should do something else so for computer to be able to comprehend the kind of data that you're giving it data types are used and there are many other reasons behind it as well another reason being determining the size of the variable so if you have a string you the size of the string is determined by the number of characters it holds if i have a string called abcd it will have four bytes it will be occupying four bytes on the other hand if i have a number it will be occupying two bytes and four bytes depending on the kind of com interpreter you have in the language and the environment you have so this also allows for computer to understand how much memory to allocate for a specific variable this is why we use variables like this so hopefully it's clear to you so let's move on so now we'll take a look at how to assign values to a variable i've already given you a little test of how that happens but let's take a look at this so we can assign a single value or we could assign multiple values so let's take a look at how that works let's say that i want to assign as we've already i've already showed you how i do that but let's just do it again let's say that i want the age i want to store someone's age let's say they are of age 25 i present this is assigning a single value to a variable so i'm assigning 25 to each if i were to type name comma h and equals 25 this is going to show me an error because it does not know how to unpack this value this is just one value and i'm expecting two values now if i were to move ahead instead of doing this as we've already seen the naming conventions are also there so you can't name a variable with that begins with a number so if i wanted to name something underscore name that would work just fine as you can see this is fine but if i were to start with anything other than underscore let's say dollar name or if i even if i were to start it with the name with a an integer number this is also going to cause an error so anything other than a character which is anything from a to z whether it's small or big and anything that is not underscore is going to cause an error so always make sure that you're assigning the variable names correctly another thing that you can do is naming a variable the variable cannot start with the number but it can end with the number so if i were to say name one this will work just fine and if i were to say name dollar this is going to cause an error because a dollar already holds a value in python language so it's a token which we'll discuss in a later video so make sure that you are naming it correctly and always make sure that you're naming your variables in a way that helps you understand what exactly is it that you're trying to write you can start with two underscores as well that will work is fine no matter how many underscores you are passing it it's going to work just fine so these are the variables that we have declared so far and we have assigned a single value to it now let's take a look at how to assign multiple values so assigning multiple values is also quite simple as you can see here if you want to assign one value to a multiple variables you can do what being done in the first line which is a equals to b equals to c equals to 10 that means set all the variables on the left hand side which is a b and c to 10. on the other hand if you want to do it you could do it otherwise as well so we could assign multiple values using the comma operator so i'll show you how that works in a moment let's just see how that works if i were to go a call a equals b equals c equals 15 and if i were to print a it's 15 b is 15 c is 15 now if i were to change it i want to assign 10 15 and 20 to all of them instead of doing the equal sign what i do is i use commas and i tell it okay a comma b comma c now i want 10 assigned to a comma 15 assigned to b and 20 assigned to c i press enter a b c so i have to make sure that i'm using the correct ordering order matters here if i were to use a b and c uh if i were to use b c and a then b will be assigned 10 c will be assigned 15 and a will be assigned 20. so make sure that the order matches with the values that you're providing it now let's take a look at python tokens all right so now let's take a look at operators so operators are just special symbols that are used to carry out arithmetic and logical operations in python there are several kinds of operators so we have all of them listed down here so the first kind is arithmetic then there's assignment operator there's comparison operator logical operator bitwise operator identity operators and membership operators and we'll take a look at them one by one so let's move on and see what are arithmetic operators well as the name suggests we use arithmetic operators to perform arithmetic operations or mathematical operations things like addition subtraction multiplication division modulus and exponentiation so addition basically adds two numbers so we can add 6 plus 5 in which plus is the operator and six and five are the operands similarly we can subtract we can multiply two numbers we can divide two numbers modulus operators is used to give us the uh remainder so if i were to go seven modular 2 it will give me 1 because when we divide 2 7 by 2 we get a remainder of 1 and similarly exponentiation is used to raise a number to a specific part so for instance if i were to type 7 then 2 times the multiplication symbol which is the asterisk and then i type 2 that means that we are multiplying 7 by itself two times so that's what these operators are for these are very easy to understand these are just basic mathematical operators and they are more very commonly used in python then comes assignment operators so assignment operators as the name suggests assigns a value to variable so let's say i have a variable x and i want to assign the value 10 to it i want it to hold the value 10 so i could just type x is equals to 10 which is what is shown here now there are some extensions to the simple assignment operator which is the equals operator you can add a plus right in front of it and what it will do is it will add more it will add the number that is on the left hand side of the operator to the right hand side of the operator to give an example as you can see we have plus equals is the operator and we type x equals to x plus 2 let's suppose that before we uh execute this this was already executed the x is equal to 10 uh statement was executed and x contained the value 10 after i run this code what will happen it is is we'll take a look at the number that x holds which is 10 and it will add 2 to it so it will become 12. now following the same logic we have minus equals so the minus equals operator is going to do the same thing but instead of adding 2 it's going to remove the number that's on the right hand side so x equals x minus 29 will subtract 29 from the already existing number in x and assign that new value to x similarly there's multiply equals that's divide equals and there's or equals so this is basically a binary operator or and bitwise operation we'll take a look at that in a moment and then there's comparison operators so comparison operators as the name suggests are used to compare two values let's say that i have two values that have been entered by the user and i want to check there i want to compare the values in them so this is where this comes into play now let's say that you have a login form and the user enters the registration name the registration number then they entered their password and just to make sure that they have entered the correct password you have a confirm password field as well so when you're validating the form you need to check whether or not password in the password field and the confirm password field are equal to each other so this is where the double equals come into play now the reason why we have two equals and not one is because one equals is used as assignment operator the operand on the left hand side gets assigned the value on the right hand side here we are comparing the two values so operands on both the sides will be compared to each other then just the opposite of it would be the not equal operator the not equal operator is used to check whether or not uh an operator or an operand is not equal to something so if i were to go and check whether 1 is not equal to 2 since 1 is not equal to 2 it will return true similarly we have less than we have greater than we have less than equal to and we have greater than equal to and their names are quite easy to understand as well they check whether or not one value is less than the other value or not or whether it's greater than or not then there's logical operators so logical operators are used to combine conditional statements so if i want to check whether or not some condition is true and the other condition is true as well uh then i use and it will return true if both the statements are true similarly there is an or statement or statements are used to check whether or not something is true or not let me just show you one example so if i were to use python i'm going to show you some python code here so let's say x is equal to 15 and y is equal to 16 now if i want to check whether x is equal to equal to 15 and y is not equal to 16 so what i can do is i can just check s is equal to equal to 15 it returns true y is not equal to 16 and it returns false now if i want to check if both of these conditions are true so then i can just type and y is not equal to 16 and i present and it returns false because one of those conditions is false so that is the problem because y is equal to 16. now if i this then it will return true so i'm checking whether x is equal to 15 and y is equal to 16. if i were to change the value of x to let's say 14 and check this condition again i'll return false now the or operator is actually a little different if i were to use instead of and i use or what will happen is it will check whether x is equals to 50 which is clearly false here and it will check y is equal to 16 if either one of those statements evaluate to true it will return true so since y is equal to 16 we are getting true but if i were to check if y is not equal to 16 since both the statements are false it'll written false so basically what we're taking a look at is if we want to check whether all the statements are true then we use the and operator if we want to check just one statement is true out of all the statements that we have provided then we use the or operator and the not operator is used to simply revert the statement so if i were to check 10 is not 10 10 it's not 10 it's going to return first because 10 is 10 but if i were to check 10 is not 11 then it returns true so i'm just checking for the uh opposite operator and that's going to work now let's move ahead and then comes bitwise operator so bitwise operators are a bit difficult to understand so let me just explain using notepad so underneath the hood inside any computer programming language numbers are represented or any value is represented using binary so binary is basically just some combination of zeros and one so when you hear something like integers can hold 32 bits basically what it means that it has 32 0 32 positions that can be filled with either 0 or 1 and any value that we see on the screen is due to some combination of 0 and 1 on in those 32 positions to give you an example let's say that i have a four bit number four bit number means four binary digits number found by four binary digits so i will have this will be zero since all the four numbers are zero now what we're doing is i want to check uh if in case you don't know anything about binary numbers i can give you a really quick refresher here each position is represented by one two four and also so there so four eight four two so what happens is if each position let's say so these are the positions that we have we have 4 3 2 1 so if any of these numbers is turned to be 1 then that number is raised to the power of 2 let me give an example if let's say this was one and this was one if this was the binary number that we had which was zero one zero one so the way we do this is we take a look at it and we go 2 raised to the power of 4 and you multiplied by the binary digit that's there which is 0 and we do the same thing for all of so if you have if i was to do the same thing to all of them let's just do this now we will go 2 raised to the power 3 and the number at the third digit position is 1 and 2 raised to the power of 2 and the number should be 0 and 2 raised to the power 1 uh 2 raised to the power 0 so this would be that this would be zeroth position and first position so all we have to do is just do one three two one and zero that will work so this should be three this should be two it should be 1 it should be 0 and we have multiplied by 1 so as you can see the number at the 0th digit is 1 so we multiply it here by 1 then at the first position is zero second position it's one and the third position is zero so what it what ends up happening is we end up creating the sequence in which we go 2 to the power of 3 is 8 multiplied by 0 plus 2 to the power of 2 which is 4 multiplied by 1 is 1 then we go 2 to the power of 1 which is 2 multiplied by 0 and we got 2 to the power of 0 which is 1 multiplied by 1 and this ends up giving us 0 plus 4 plus 0 plus 1 and we get 5. so this might seem a bit complicated but that's how the numbers are calculated underneath the hood you can take a look at some binary refresher that will take you look at what it means now because we only have four places to put zeros and one since we have four digits we could go from a number that has all zeros to all one and everything in between this could end up in numbers ranging from 0 to 16 so if we have four binary digits then we can make numbers we can represent numbers in binary format ranging from 0 to 16. anything above that we have run out of space we can't do anything about that 0 to 50. so that's how we will do it and anything in between any configurations like 1 zero zero zero can also represent some number between zero and sixty now we come to bitwise operators so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so what they do is they instead of operating on the numbers that we see they operate on their binary forms so let me give an example we have an and operator so what and does is if i were to give you 0 and 0 it will return 0 similarly 0 and 1 will return 0 1 and 0 will return 0 and 1 and 1 will return one so what it does is very much like the and operator that we had taken a look at previously in the logical operators section it takes a look at all the operands in this case we have two operands because it's a binary operator and we take a look at the left of operand and the right operand and if both of them are one then we get one if either one of them or both of them are zero then we get zero so this is what it looks like similarly for r what we end up doing is just as we did in the logical operator just one of them need to be true so zero could be considered false and one could be considered true and then we'll get the value so since both of them are false we could both of them are zero we get zero one we get one for you the second and the third one and all of them we get one so as you can see this is what the operators do the binary and binary or operators xor is a bit special so xor is used for exclusive or that means both of them should not be same either one of them has to be one but if both of them are one or both of them are zero then the value that is returned should be just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session these are exclusively used in the building of logical gates and all that but they are also used very much in programming and there are some very nifty tricks that you can do with binary operators that could allow you to create more efficient programs so do take a look at them so these are all the operators that we have studied so far let's take a look at left shift and right shift so what left shift does is let's say that i have a number like this and i want to shift it by two so this number represents one now what i do is i want to shift i go left shift two this basically means that whatever number we have shift it to the left by one so what happens is it will shift all of these zeros by one and pad the left part with zero basically move it to the left hand side by the positions that i have so since i have given two it will do it twice so as you can see first one was at the zeroth position then it was shifted two times so now it's one and two in the second position and from one we have come to four right so that's that's how this works so this is what the operator left sheet operator does it takes the binary format and shifts it by two now on the other hand we also have right shaped operators and it does exactly the same thing but it does it in reverse so if i were to give it this and just change the left shift to operator to the right shift operator it will give me back the original result it will give me back zero zero zero one because it will shift these two to the left there are nothing there so it's removed and add two zeros at the begin then we get this we remove this and we get this so this is what the binary operators do binary operators work on the binary format they shift it to the left they shift it to the right and at the very end let me show you what the not operator does because this is very uh something that's not shown very accurately not operators turn the number from uh turn all the bits from 1 to 0 and 0 to 1. so if i were to give it 0 0 0 1 and if i were to use the not operator right in front of it what will happen is it will take a look at all the binary digits and it will flip them so if it's 0 it's converted to 1 again it's 0 convert to 1 0 convert to 1 and 1 then convert it to 0. so essentially we are just converting the numbers now when you do use it make sure that you understand how the signs work so in binary format all the numbers that are stored in the negative numbers there is a few nifty things that go on in the background so make sure that you understand how the signs work and when you shift the numbers and their binary representation will flip so all the numbers that are 0 will convert to 1 and all the numbers that are 1 will be converted to 0. so that's how the binary operators work they're very easy to understand once you understand the basics of how binary works underneath the hood and you can do some pretty powerful and pretty efficient things underneath the hood when you understand the binary digits work so let's move on and then we have identity operator so what identity operator does is it's used to check the whether the object that we have is the same or not let me give an example so if i were to open python uh and i want to use the id method and i want to pass it a number one you see this long numbers long number this is what's called the id of the object since python is an object oriented language numbers are represented as a object of integer class so if i were to type try to figure out what the type is of one i'll get class of integer so if i would and similarly if i were to check type of two i get this and if i were to get the id of two it's this as you can see these two numbers the id of two and id of one are not similar similarly when you create your own classes you create your own objects they have their own ids as well this is used to differentiate between two objects that have almost the same structure but still there are two separate objects so if i have two different kinds of uh strings or two different kind of numbers let's say i have one 11 and i check the id of this it's this and this is this so as you can see both of them have 11 and they though they don't have the same id because strings are immutable so as you can see these have the same numbers one eight one eight seven five two and same so these are used to uh to check whether the id of two objects is same or not so if i were to check with the is and is not operator if i were to check one is one since both of them have the same id illusion true but if i were to check one is one it will return false so this is this is what happens with this if i were to check one is not string one and it's true so that's how it works and this could also be applied to objects when you're learning object-oriented programming you can create your own objects and then you can take a look at that and then comes the membership operator now this is also very quite useful and i think python has it in many other languages don't so it's an operator that allows us to check whether or not a number is in a sequence or an object so to give an example uh let's say that i have a list of numbers so i have one two three four okay i have one two three and four and then nums so i have four numbers in a list now if i want to check whether you number let's say entered by the user is present in this list or not then i can simply instead of just going through each running a loop and then going to looking at each number going is one equal to the number that the user entered is 2 equal to is 3 equal to is 4 equal to that number i could just make python do it easily by typing 4 in nums let's say the user entered the number four and yours and it returns true because four is present if i were to check eight in nums it'll return false because eight is not present in the string but if i were to add it and then take a look at nums and now if i check if it is in the nums it is so that's what the membership operator does if you want to check whether something is not present in nouns i can just do this and neutral and false and if i were to go and remove dot pop so it is removed if i take a look at nums now and if i check whether 8 is not in nums it is written true so that's how that works so membership operator suggests you to check whether or not something is present inside a container or inside a group of sequence that we have and with that we have come to the end of operator section and we'll move on to data types in python so python tokens in python every logical line of code is broken down into components these components are called tokens so there are many test tokens the normal types of tokens that we discuss are keywords identifiers literals and operators so everything that you write in python is a token of one kind or the other let's take a look at them one by one so keywords what are keywords well in python keywords are special reserved words they hold special meaning so these words are something that you cannot use to define a variable so they convey a special meaning to the compiler or the interpreter when the compiler or the interpreter takes a look at this word they'll understand that it has to perform certain action it has to allocate memory it has to create something on the call stack it has to do something in the background instead of just treating it as a normal variable now each keyword has a special meaning and a specific operation so we'll take a look at them one by one we'll come across many keywords we'll take a look at them what they mean one by one we should never use keyword as a variable that because that's going to cause a lot of problems when we run into a later related code and we'll understand what that means in a moment as well so these are some of the keywords that python uses so as and continue break except dell len from import pass lambda there are many many others and these all hold special meaning and as you get deeper and deeper understanding of what python has to offer and how you can use python to create your own applications you'll understand where these keywords are used the main point that you should understand is you should never use them as a as a variable name so again let me show you an example let's say i open the python console now if i want to type ret is equal to 7 this works just fine but if i were to type return return that's a special keyword and we'll take a look at what that means in a moment but if i were to assign it to 7 i will get an invalid syntax error mainly because return is already a keyword if i were to type return 1 again that would work just fine but make if you try to use some keyword for this this is going to cause the problem now now that that is done let's take a look at something else so these are the keywords but there are other two concepts called identifiers so an identifier is mainly a name that is given to something in python that we can give that allows us to identify it later on so these could be names given to variable names given to a function a class or an object in case you are not familiar with function or class or object you are familiar with variables because this is what we just discussed but functions classes objects everything else will be discussed later on so don't worry about if you don't understand it as of now you'll get to understand it throughout the runtime of this presentation so there are certain rules that we need to follow when we're naming an identifier the first thing is no special character except underscore can be used as an identifier so we can't use a special character to be an identified a variable name or anything similarly keywords are not something that you can use in place of an identifier so as we already saw we can't use return we can't use four there are many other keywords that you cannot use as variable names as something that you can use as an identifier then python is case sensitive so that a variable which is named v a r with v capitalized and a variable named v a r with every characters in smallest lowercase these are two different identifiers so if i were to type v a r with v capitalized equals to 7 and type small v small n small r equals to 7 and if i equals to 8 and if i were to print the values both we will get different values so these are two different things in when python interpreter takes a look at it it'll assign two different pockets for them then the the first character of an identifier can be an alphabet or an underscore but not a digit so as we have already seen that we can use any alphabet as the starting character of our identifier variable name on the other hand we can use underscore as well but we cannot use a number a digit is not something that we can use so that's you can use it afterwards it could be the second or the last character or anything in between but can't be the first one so let's take a look at them if i were to open the python console we have several ways of doing it in python a variable is also an identifier so let me just show you the casing pro so variable 7 if i were to name it with a capitalized v it's a 7 and if i were to name all of them capitalize with 7. so let me just change it now it's 7 it's 71 and 72 so if i were to print var with everything in lowercase it's 7. if i were to print it with b capitalized it's 71. if i were to print it all capitalized it's 72. so all of them hold different values and the last thing is we cannot start it with a number so let's say 1 var equals to 7 we'll get a syntaxes but if i were to do it v 1 a r this is just fine it will work v 1 a r and it works just fine now we come to literals so literals are just raw data that is given to a variable so literals can be of many types string literals numerical literals boolean literals special returns and we'll take a look at them one by one so as you can see we can have several kinds of literal this is some code that's been written to you written for you and we'll take a look at string literals first so found by enclosing a text with quotes both single quotes or double quotes can be used so this is some code that you can take a look at and you can type it in your own console you can type it in any other kind of environment in which you can run python code i will uh expect you to run it in console because that's where you get the most immediate feedback but it's your choice to run it in any other environment if you're comfortable with it so let me just show you what we can do here so i open this and as i've already discussed we need to enclose our text within quotes to tell the python interpreter that it's a string let's try it so if i were to give path is a variable and i want to assign a string literal to it i can type sample path press enter and it works this is simple if i were to type single quotes this wouldn't make much difference it's going to be just the same it's going to work just fine now the reason why we have single and double quotes for this it's mainly because in c and c plus plus and j and many other languages like java single quotes were used for handling a single character not a string but a single character so a single character would be something like a that's a single character a string with length of ones is something that's called a single character now the way it worked in java and c and c plus plus was that if you were to attach multiple characters one after the other so let's say a b c d and then you were to do it that way then that would be a string and for that you can't use single quotes you have to use double quotes and simplifying things a lot because there's a lot undergoing like the null pointer and all but you don't need to worry about that just need to understand why there's two codes and why there's one good and that's the thing i'm trying to get across so if a person shifts from uh switch off a person's shift from c plus plus or java to python they will be expected to use or they will think they'll be using a single quotation mark for a single character and that would work and for that to work they have created uh for they have allowed for us to use both single quotations and double quotations there's also one thing that you could do you could use three single quotes as well so if i were to write a really really really long line of code instead or a really really long line of string i could just start it with three quotes i press enter as you can see the prompt instead of it being three arrows pointing left it's now become three dots now i can type anything let's say that i'm typing this i press enter it's still allowing me to type i type this let's say that you're typing a paragraph or a note or some or an email or something like this i can do it this way now let's say that this is everything that i wanted to type including the enter character now if i want to end it again i type three single quotations press enter i get back the prompt with three uh arrows pointing left i type in the word line press enter and as you can see i get everything this backslash n characters is something that is used to determine a new line so if i were to print it using the print statement function that we have already discussed press line as you can see it presses it starts here enters or creates a new line prints everything wherever the backslash n character comes in then at the end it again uh starts a new line and then ends it there so the backslash n character is a special character that tells you that there is a new line here so you don't have to worry about that as of now but just understand that that's how we do it it's not just strings though there are many other different kinds of literals as well there are numeric literals as well and numeric literals allow us to use use variables that can store numbers now we can have positive and negative whole numbers with no fraction part as integers as we have already discussed we could have real numbers real numbers are numbers with fractional part using the float variable and we could have long long is also something that could be used to store uh values but the important thing is that it could store a much larger value than integer so as you can see in the description it says an unlimited string of integers followed by uppercase l or lowercase and i'll show you what that means in a moment and then it's also something that you could do you could store some complex numbers so numbers with real and imaginary parts now if you've worked with uh if you worked with mathematics if you worked with the real and complex numbers that you understand what i'm talking about if you're not work with it that's totally fine it's not something that's used very often it's only used in special cases where you need to display complex numbers so in our case let's just take a look at this we have a positive and negative numbers so we can store that in integer as well let's say that i want to store negative 77 i can store it in number or positive 7 i can store it in number and the type of number will still be a class of integer right but if i were to attach capitalized l here that would cause an error oh because it's new version so nevermind so if that was the case then i could do that but it's not yeah so as you can see it's working fine now if i were to do a lot of other things like floating point numbers 1.56 and if i were to get the type of it and press enter this would give me a class of float so float as we have already discussed is something that is used to store floating point numbers or fractional numbers or real numbers however you want to call it so that's how we stored that number now there are many differences between how these are stored in in underneath the hood they are stored using binary binary format and we don't need to get into that but the thing that we need to understand is that when we're using a binary format underneath the hood python takes a look at the data type and then decides how it wants to set the binary format of that number so that's why we do it that way now there are many other ways you could do it and may you could use many other many other tricks as well to store other kinds of numbers convert float to integer can divide two numbers and make it convert to float or anything else that's also doable but it's it's mostly that you are supposed to do it uh easily that's there make sure that you in the easiest option make sure make sure you're choosing an option that works for you in person the value of an integer is not restricted by the number of bits so it can expand to the limit of available memory and no special arrangement is required for storing large numbers now that is mainly because in python you don't need to uh as i've already told you it's a high level language it's not a low level language so you don't have to worry about changing the types or the available bit size of a number when the number becomes large python will do it for you automatically it will take a look at the number it will take a look at whether or not it's exceeding the current memory bounds and it'll assign a larger memory bound for it so that you could add more numbers to it unless and until it reaches to a point where it's uh overriding the available memory that then there's no memory to store the number and cause an error and no special arrangement is required for storing large numbers python again does it for you so you can just follow on uh working on your application instead of working with the nitty-gritty details of how things work underneath the hood this is why i told you you don't need to worry about the binary arrangement underneath the hood python will do it for you then comes boolean so booleans uh evaluate to true or false true and false are basically a human construct so let me just show you what that means if i want to check something let's say that there's a user and i'm building an application and i ask him to enter a password he says the password is abcd he's creating his account he says abcd then it comes to confirm password and he writes abcd again now i want to check whether or not password and confirm password contain the same number so i press password equals to equals to confirm password i press enter and i get a boolean value of true so this is what allows me to understand how to move forward if it returns true then i can basically move ahead and tell the user okay everything worked perfectly i'm going to store it in the database and do whatever i want with it on the other hand if it had returned false let's say the confirm password was abcd1 the user mistyped it and now i check whether or not they are equal i get false this is what boolean values are you can assign them yourself so let's say vol equals to true make sure that you understand that the first letter is capitalized so a smaller letter t r ue will not work since python is case sensitive so if i were to type that's true and i can also assign false to it press enter and this works as well so this is how that works now that boolean is uh understood let's move ahead and see what other things that we have for us so we have special literals these uh special literals are something that we can use for ourselves so these special literals in python are called none which means that the variable is yet to be initialized so if you're coming from other languages there's concept called null n n-u-l-l so that's basically what python uses but instead of null we use none so let's keep let me give an example again let's say that the user is entering something the confirm password and the confirm password field has been left blank so instead of writing something inside it he chose to wrote nothing and they submitted i will get a none value here that means absence of a value that the user has not provided a value so that could that basically means that if i print confirm password now i will get nothing because nothing is there it contains no value it's empty think of it as a box that contains nothing as of now and when the user does enter something that box will contain that value so that's what none is used for it's used to define absence of value not an empty string not any other kind of string not zero not anything else but in absence of value and the type of none is none type in case you were wondering and now we have operators so let's take a look at some data types in python so data types and pythons would be divided into two parts immutable and mutable so immutable data types are data types that cannot change on the other hand mutable are data trends the data types that could have their values changed so for instance string numbers and tuples will have some value assigned to them and then when we want to change them instead of adding something to it it will create a new data type for that it will create a new value for that variable to hold on the other hand in mutable we have lists dictionaries sets and then lists we have several types of generic list or tuples and all we'll take a look at them one by one so let's take a look at them so we have numbers so a number is basically as we've already discussed data types such as integer float and complex data types they come in numbers so as you can see a whole number with no decimal point is integer a fractional number a number that has one or more decimal one or more numbers after the decimal point uh is floating point number and a complex number is a number with uh real and imaginary parts so again complex numbers are not that prevalent mostly we use integers and floats complex number have some use case but not a lot then comes strings so a string is basically a lot of characters that are enclosed within either a single or double quotes and they are used to store text so a string literal could look like this as we've already seen so there are some operations that are being performed on string and we'll take a look at them now so if i were to open my python prompt let me just define a string so sdr ing equals to hopefully you can see this and if i type a b c d e f g h press enter this is the string now if i want to take a look at the length of the string how many characters are there in this uh enclosed within the double quotes i will type length string and i have eight characters one two three four five six seven eight so that's correct now let's say that i want only the first four characters this is what is known as slicing this could be done with a string or with any other character as well firstly let me show you what happens if i do this i get a this is what is known as indexing into a string basically what i'm doing is i'm saying in the string variable whatever data it holds i want the data that is stored within the first position and in string everything starts with the position starts from zero so zero is the first position one is the second position and by that logic since there are eight variables seven will be the last position i press seven and i get h if i try to go outside these points let's say i press nine i get index out of range basically uh there is nothing after the position 7 everything outside that is not accessible by python we have not assigned any memory to it so that's illegal for us to do and that's why we get an index error as you can see here index error mainly because we are using this and this is what is known as an index something that is enclosed after a variable named enclosed within two brackets just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pad to know the right answer now let's continue with the session so now that we know how to access a single variable a single character in a string let's say that i want the first four characters first four as an a b c d so i start from zero and i want everything before the fourth character before the fourth character why well because uh 0 1 2 and 3 are the first four characters because it starts from 0 so we have 0 1 2 3 which are of course 4 characters so how do i get all of them at once let's say there are 15 and i want 0 to 14. so what i can do is i can type 0 after that i type a colon and i type 4 this means get me everything from the beginning of the string and write before the fourth kent so the fourth character is e and before that is d i want everything from a till d press enter and i get a sub string of it which is a b c d so this is what uh slicing a string looks like this is what's known as a slice operator now you can do it every other way as well it's not necessarily that you start with zero you can start with three to four which will give you i think just one character which is d now another thing if i were to leave this off what do you think will happen pause the video and try to think about it but if i were to do it now it starts from zero so it defaults to zero if i were to start it with the number that uh this it will give me an empty string but it makes no sense so that's how you do that and finally if i were to leave four off since we know what happens here i think we can probably guess what's going to happen here i'm going to press enter and you can see what happens what happens is we take everything from five till the end so we have the fifth character or this the sixth character in this which is on the fifth index is uh let me just uh print the string again let's go number correctly so it's this so this is zero this is one this is two this is three this is four and this is five i want everything from the fifth character till the last character so this is what that means and finally i can use negative indexing here as well so i want everything from the beginning till the last removing the last one character if i were to remove the last two characters i can do this and this works just fine as well so that's how slicing works another operation we can perform is replace something in this so let's say string dot replace if i want to show you the example here as you can see it says replace e d with e and it will do that here but let me just show you replace f g i press enter it returns another string to me which is a b c d e g g h now if i were to take a look at the string variable that contained our variable value it has the same data so when we perform this replace operation what we're actually doing is we're saying give me another string the in which you have replaced all the f's with g's this is especially useful if you're trying to remove some content out of a long line of text so let's say that you have 17 lines of text in which you want to remove all the let's say you want to remove all the vowels for some reason you could just uh run this and see if there is any a e i o or u and just remove that that will work just fine as well so now that we're done with string now we're done with data type string let's move ahead now comes tuples tuples are a sequence of immutable python objects so what does that mean well let's say that you want to store the number of or the name of weeks or in string format in a variable so we have uh monday tuesday wednesday thursday friday saturday sunday seven days in a week and all of them need to be stored in a single variable now there are many ways to do it one important thing that you need to notice here is that this data is not going to change ever there is going no time future are you going to go that we need to add another day to the week that doesn't seem very feasible so because it's not going to change we are going to use an immutable data structure or an immutable type which means adding something to it is going to be uh it's not going to be something that's allowed so let's say that i want weeks now i want to store everything in one i could certainly create variables that say sun which will contain sunday and similarly month tuesday wednesday thursday friday saturday that's certainly doable but again it runs into the same problem let's say that we had 14 things that we need to store let's say that we had 100 things that we needed to store and we needed to access them using one variable that would be very difficult to remember the variable names of 100 different kind of variables it would be better if you could store them just in one variable and then access them using the position syntax that we had discussed earlier in string like this one so this is where tuples come into play so let's say weeks and i enclose it in brackets but that's not really necessary but i i would do that here now let me just type in sunday and you could type it with me monday choose day wednesday thursday make sure that you're separating them with commas and typing the space after commas to make it more readable that's not really necessary friday and finally saturday press enter i press weeks and this is what we get if i want to take a look at the type of this t y p e it's tuple so uh now i said i used commas here and that's not really necessary if i want to use this this would also work the way python identifies that this is a tuple that we want to do the data is by taking a look at this comma so it takes a look at this line it says okay weeks need to be assigned somewhere some value it takes a look at sunday it says okay one string and that's comma that means other values are also going to be assigned and this is a tuple even if i had not put the parenthesis before and after opening processes and closing parenthesis to enclose this list it would work just fine now one thing that i would like to show you is that i were to go weeks zero i get sunday weeks six should give me saturday right but if i were to assign some other value to it let's say any gibberish value i press enter and it gives me another tuple object does not support item assignment now this is one of the major advantages of using immutable object it does not let anything uh in the data that you have already entered to be manipulated so if you have entered a list of something that you know is not going to ever change then tuples are the best option for you so this is why we use tuples so now let's take a look at something else we have lists dictionaries and sets so lists are very much same to take tuples one major difference is that you can make changes in a list so if you have dynamic data that changes rapidly then you can use a list for that instead of creating new tools for every change that has occurred let me show you an example let's say that instead of weeks i wanted to store let's say that i wanted to tour salaries of people right i can store salaries of three people let's say that it's stored in thousands so ten means ten thousand fifteen thousand twenty thousand press enter and now if i were to take a look at salaries press enter i have three salaries if i were to take a look at the type of salaries i would get list it's not a tuple it's a list that means that if i want to if i want to change the salary of a person because it does happen that a person gets promoted they get an increment of whatever happens they say that the person at the index 0 is now going to get a salary of 18 000 and now it does not throw any error because i am using a list and i can store any kind of data it's still a list and if i were to print it now it's 18. another cool trick that i can show you is that instead of this doing it like this let me just assign 10 to it and let's say that the thing that i want to do is i want to instead of assigning a new salary i want to add 8000 to the guys first to the person's current salary now there are many ways to do it first way to do it would be uh salaries of 0 equals to salaries of 0 plus 10 so what happens here is i take a look at this i want to assign the value at index 0 to be the current salary of the person and add 10 more to it let's add 8 more to it to add consistency so as you can see this is what it looks like and now if i were to look at it it works just like that but as you can see the typing this is quite long it's a bit repetitive so you get if you've already taken a look at the operators slide that we have taken that we have we have gone through one operator there was plus 8 now what will happen is it will add 8 to the already existing salary of the person at index 0 which is 18 so 18 plus 8 would give you 30 26 and that's what we've got so you can do it this way you can add remove you can add data to it as well so i could go salaries dot append append will allow me to add a new salary to up for a person so let's say that it's 28. i press enter now instead of three it contains four salaries append is not something that you could do on a tuple so that's how you do it and another thing is that instead of storing all everything as an integer value you can store data of any type let's say that i want to store 1 k and i want to store a floating point value as well this is also doable so i can type mixed equals to this this is one of the advantages of using python many languages don't allow for this kind of inter mixing of data when just trying to store it in an array or in a list so you can take a look at that now if i were to type next i get this i can store any other kind of data i can even store another list inside a list so if i wanted to store another list 155 comma b i'm just adding some gibberish value just to show you this is doable i can add another tuple to it this time i need to put called this parenthesis so to describe i'm adding a tuple 88 77 and it's done now if i take a look at mixed i have this if i want to take a look at mixed of four right it's tuple and i can take a look at the type of the tuple so to see if it's a tuple or not and it's a tool and if i were to take a look at the type of something at index 3 it would be a list so you can nest any kind of thing but just don't go too crazy with it that could cause a problem you will not be able to comprehend the data that you have if you go extremely uh benign on it then we have dictionaries in other languages they are called hash maps or hash tables so a major advantage of using a dictionary over a list is firstly it allows you to create a key value pair so again let me just show you so if i want to associate a person's name to the person's salary instead of doing a list which could only be accessed using a numeric index like 0 1 2 3 what i can do is i can create again salaries equal to and i can create a dictionary like this add two curly braces inside it add the key which would be the person's name let's say john and end the quotation and now the person whose name is john gets fifteen thousand let's say that there's another woman who's named jane she gets fourteen thousand let's say that there's another woman named another man that's named johnny and he gets 5000. press enter and now if i were to print salaries it will display the key value page if i were to take a look at the type it will give me a class of dictionary so that's all good but one thing that it allows me to do now is i can access it using the person's name so let's say that i have salaries i want to get the salary of jane press enter i get 14 that means jane earns 14 000. let's say that instead of jane i want john as you can see john gets 15 000. and if i were to use a name that doesn't exist i'm going to get an error this is called a key error this key does not exist now a way to come across this or come over this is instead of indexing directly you can use get so i want salary of john but if it's not available give me 15. so i'm getting 15 because that's the salary of john and if let's say that i want to use some other key that is non-existent the person named john asd is not available in our in our dictionary so if i press enter i'll get 18 which is the default value i could set it to anything i could even set it to zero so now if i i try to access a person whose name is not in available in our dictionary i am going to get zero so that's one of the major advantages another is really fast so even if you have like 10 000 records the way hashtag works or the dictionaries work underneath the hood is instead of it going through all the 10 000 names and finding the name that you wanted to find it does some clever tricks and makes it really really fast this is why if you are doing something that requires really fast access to some data and you can uh give some unique key for that data to be accessed then definitely use dictionaries instead of using lists because in lists you would have to you could in lists do something like this store a list of list in which the first thing is the person's name second thing is the person selling i could do it here as well first thing is the person's name jane and the salary of jane is let's say 80 okay now if i wanted to i could define a function that could find this or do a lot of things but the important thing to understand is if it was let's say 10 000 records and i wanted to find a person's name named let's say that a person's name was not john or jane i wanted to find a person whose name is at the end of this list let's say i don't know where the name is that the person's name is andy so we go through the entire list searching for the first element and checking if that's first element is andy and if it is handy then we print the salary if not then we print zero now for that we have to take a look at all the 10 000 elements in dictionary what we do is we can just give the name and dictionaries will do some clever tricks behind the scene that you don't need to worry about and it will instantly find it for you so always use a dictionary when you have large sets of data and you want to constantly find things in it if you want to just store some data and you know you can access it using numerical indexes and the data keeps changing then use lists because in tuples you can't change the data so if i have some let's say i have 0 and i want uh the person with the employee id of zero to have salary or something then i could press zero here it's not going to work because i've reassigned it to a dictionary so i'm getting a key error but you can understand my point on the other hand let's say that i have a data set which does not change and i want to access it using numerical indexes then tuples come into play and you used to use two and finally we get two sets so at entire pad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills sets are by far one of the most underused data sets and you need to understand why we use sets so sets are again unordered collection of immutable data which has no duplicate elements so what does that mean i can create a set by the way uh the way i am showing you how to create dictionaries and all that's not really necessary let's say that i want to create my sample dictionary i can just use the keyword dict function and it will work just fine now it's an empty dictionary and i can add data to it uh another thing you can add data using dictionary and typing in the name and then assigning a value this will work just fine now the thing you need to understand is uh similarly you could use instead of this you could use triple this will create a tuple and l list will create a list now i want to create a set so let's say that i name it s now i can do it this way but uh i won't be able to add anything because this will be taken a look at as a dictionary so the best way to do it is use the keyword set or the function set and now if i take a look at s it's a set so what is the set set if you have worked with mathematics and you have worked with the band diagrams and everything like that you are quite understandable of what set is already a set is basically something that contains a lot of values but it does not contain duplicate values and it allows you to check whether or not something it contains a value or not in constant time so let me give an example i think s dot add one would work now if i take a look at s it has one if i were to add two it contains two now if i were to add two again it instead of containing two elements named two it contains one element which is two with the value of two now if i want to check whether or not something exists in a set let's say one in s and it will show you two this is the in operator or the membership operator that we have already taken a look at and if i were to take a look at whether two uh whether let's say i want to check whether five exist or three exist it's going to be false so why are we doing this well one thing that you can take a look at here is that it again since if we are using set it is extremely fast for us to perform this operation let's say that there were a million records in this and i wanted to check whether something exist in it or not uh the first intuition that comes into our mind is to take a look at everything that is inside the set all the 1 million things and compare it with the data that we want to find if it's not there then we return false if it is there if it's found and while we're taking a look at all the 1 million 1 million data points then we return true now again that is fine but if it's one million records then it takes a lot of time and let's say that you had to do it consider constantly let's say that you had to check whether or not something exists in those 100 records 10 000 times 20 000 times that's a lot of computation so again sets do some really complicated mathematical things underneath the hood to basically just check whether or not something exists inside it in real time that's why it doesn't contain any duplicate values in this as well and so i can do one in s as well if i were to assign a list of one comma two to it and then instead of one in s i can type one in l and that will return true as well the difference here is that it takes a look at all the elements one two and whatever finds if something exists in it or not whether whereas in set it's extremely fast so if you have some data that you want to keep track of and want to check whether or not another value exists or you want to deduplicate the data you can do that as well so you set when you want to check memberships really fast you can perform the union intersection and all that and that's very easy to do with sets as well so now let's take a look at how to uh deal with sets and how to deal with different data types i'll show you some hands-on to further strengthen your knowledge of data types so let's take a look at the setup that we are working with so we'll be taking a look at data types we'll be taking a look at lists sets uh dictionaries and tuples the things that we have already discussed but instead of typing into the python console that we had done earlier let me show you how this was the console that we had typed code into now for typing out single lines and executing them this console is actually very good but let me just exit out of it when you want to type in a lot of code and you want to open the file open a code file and do execute it and run all that i would recommend that you use visual studio code so let me show you what it is let me just open a new window to a new window and here type in vs code press enter and open this once you've done that you can download it for windows or for any other operating system that you have after you have downloaded it you can install it like any other software that you install but after doing that just right click on a folder that you want to open it into type and press the open with code forms it will open within this code board so it's done and as you can see there are no files as of now in this folder the folders name is hands-on in which we'll be performing the hands-on let me create a file called app dot py py is the extension the python extension press enter now just to make it clear you don't have to use vs4 if you don't want to you can use notepad for this as well just go to the folder create a file named app.py and right and click on edit it will open it in notepad and you can make the changes there as well there's virtually no difference now what we need to do is i open this and let me just make some changes i'll increase the font size so that you can see a little better so it's a loading extensions and while it's doing that open the command pro to do that just go into the address bar delete everything type cmd press enter the reason why we do it this way is because we want to open this command window in this folder so that the files that we create the app.py file i want to run it using the python command if you have installed python then it's already available for you so you can do it this way now if i open this as you can see i can type in a lot of things so let me just increase the font size i think it's now i'm going to type some python code hopefully it's visible to you all so in visual studio code you can write code and the reason why i'm choosing this is because it shows you some syntax highlighting it shows you if you've written something wrong it autoformats the code for you does a lot of things for you right out of it so to perform this what i'll do is the first thing we'll have to do is we have to use lists so let's say that i create a list named nums equal to and the numbers that i want to insert in it are 1 2 3 4. so the first task i want to do is i want to print it so i print nums save the file when you save it this icon changes from a filled circle to closing uh to an x now that that is done open the command prompt and type p y t h o n python and the name of the file which is app.py again i press enter and it's there let me just increase the font size here as well so that is easier for you to see uh let's say it's 28 that's easier to see yeah so again python space and the name of the file which is app.py in our case and one thing that you should notice is that app.py is in the folder in which the command prompt is open let's see user my username desktop and in the desktop we have a hands-on folder inside which we have created the app.p wi-fi this is why this is working another thing you can do is you can press this command but it would work sometimes and sometimes it won't work so i don't like doing it that way and it gives you this line of code as well which is fine but we're doing the same thing we are typing the part of your typing python and the name of the file you can do it either way that you want now that that is done let me just add a comment so a comment is basically something that you add in a code so that you can explain your code but now if i type anything here this code will not be executed by interpreter it's just for the reader of the code so any person who's reading the code can take a look at the comment and understand so i'll type declare array and print declare list and print right if i run this again it's not going to make any difference because it's a comment now that that is done let me show you how you can add something to the list so you get the append method in the append method i can type in a number uh it could be of anything it doesn't need to be a number it could be a string it could be an object as well i'll type in a number let's say that i want to add 5 to it i save it i print it again run it and i think i've run into an error yeah i want to print nums sorry and as you can see now nums has five in it i can do a lot of things in it as well instead of that i could use the pop method pop method removes the last element if i don't pass in an index so if i were to store the value what it does is that it removes the value and returns it to so that i can also take a look at what was removed and now if i print nums run this this is the number i added 5 to it it's this remove the remove the element at the end which was 5 and now i printed it's 4 again but a cool thing that we can do is instead of not specifying the index we can actually specify what is the index of the element that you want to return so if i want to remove something at the beginning of the list i type in zero this would remove one from it so if i run this again instead of five we'll see one remote so one is removed and now it's two three four five so again you can do a lot of things with it one of the things was this now let me show you something that's uh really interesting so if i want to print all of them what i do is i use the for loop and we'll discuss this in a later slide but just to give an example of where looping is useful if i have 10 000 elements instead of accessing them one by one and writing things like print num 0 just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session and then i keep going on like print num one num two num three so you print all the four numbers what i can do is i can just print a loop and tell it that i want to print everything inside the list so everything in this list i want to do something with it and what i want to do will be indented here do you notice that i put a tab after this or visual studio code does it for me this is what's called indentation this is what different uh tells python what is the code that i want to execute in a particular block so if i type print text and if i do this as you can see it's printed two three four all of them in a new line for me this is what the loop looks like now if i had not done it this way if i had done it this way then python would have no idea whether or not i want to include this line in the loop whether this should be executed in the loop or not or to give you another example now i want to print done done will be printed at the end of the file so if i run this it's printing done after each execution but if i unindent it if i push it to the left side i run it again and now it's printing done afterwards the python looks at it goes okay everything that's underneath this uh for loop that's indented one point to the right is going to be something that needs to be executed with within this loop and this is how python and read your file and understand what is the code that i need to perform and how so make sure that you understand the indentation now that we have looped over this as well let me show you something about tuples so instead of uh one two three four five if i remove the parenthesis what do you think will happen press enter so it prints everything but it immediately gives me an error that there's no way to add something to a tuple if you remember we have already discussed that tuples are not something that you can add something to they're immutable so that's why we do this so instead of appending i don't think we can remove things as well i press enter and pop is also not available but you can print them you can loop over them just as we did earlier as you can see one two three four one two three four done it's completely do it now let's move on to dictionaries let me type this t i c d i o n error dictionary or let's say i'll call it cell i'll define a dictionary the way i did previously j 15 john 20 i need to add it as a strict now that that is done if i print it let me just remove this it's this i want to add something to the list or to the dictionary i can just do it this way i want to add andy to the list and he earns 25k now if i were to print this let me just yeah now we're getting andy here as well as you can see jane john andy so this is working if i want to delete something from the list let's say that andy i don't want to print uh i don't want andy in this list no i use the dell keyword inside i just type in cell of andy i run this again and andy is removed so that is fine that's how you remove an element from a list or a dictionary other operations we have already performed one thing that we haven't performed is looping over this so let me just show you for item in and here things get a bit complicated so instead of just sal i have to type items if i just want to loop over the keys i can type style dot keys and if i print item what do you think will be printed so uh pause the video if you want to think about it and then answer but what will be printed are the keys so the keys are jane and john remember a dictionary the key value pair these are the keys these are the values so jane earns 15 john earns 20. so we type it we've printed the keys now if you don't want to print the keys let's say we want to print the values i do that now i can only print the values but let's say that i want both of them items and i want key as well as well now i can print key comma and as you can see i'm printing jane space 15 which is the key comma value so we're getting the data that we want now another thing that we can do is we can print j in cell print it and we get true it's the same operation it's a membership operation but if i were to type in dsf i'm going to get false so again this is what it means and now let's take a look at a set so let's say yes create effect another thing you can do is you can use this symbol but instead of typing a key value you just type in the keys so if i print the type of s and i run this it's a set now so if i want to keep it empty then it would become a dictionary because by the this is this is what the default python behavior is so this is what it looks like we have a set for us now if i want to add something to the side i just use the add method i want to add one and i will do it two i want to add three and now if i were to print s it's 1 2 3 so this works fine but if i want to loop over it for x in s let me just print x as you can see we get all the numbers in it and if i were to print the same thing that we did earlier one in s i'll get true and if i were to print uh four ns i get false so this is what this looks like this is what our code looks like this is how it works so hopefully that was informative now let's go ahead and see what else can we learn about python so now let's take a look at comprehensions comprehensions are quite an interesting feature in python they're very easy to use they're very informative and they're quite fun to work with so let's see what they mean as of now we know how to create a list i asked you to create a list and let's say that i tell you that hey i want you to create a list and in that list i want you to enter number from one to five what are you going to do then unless you have not one from five let's say that i say i want you to enter in a list i want you to create a list and add a number from let's say 1 to 10 or it could be anything it's it doesn't even have to be 1 to 10 it could be any arbitrary number now the robot doing that well we know we can do it using loops and that's how many languages ask you to do it so i'll create a list which is empty and for let me show you how to loop to a certain extent i want to loop for x in range which is a function that allows us to loop over a particular range i want to loop from 0 to 10 so it will look from 0 1 2 3 4 5 6 7 8 till 9 not 10 because the end is exclusive so always remember that and now if i do l dot append x and finally you can print x not x l uh if i were to clear the screen and type in this as you can see we get zero one two three four five six seven eight nine now this is fine but a major problem that you can see with this is the fact that we have to write a lot of code wouldn't it be nice if we could just uh compress this all into a single uh compress all of this into a single line of code because we are just instructing the computer to add something to a list right so this is possible using comprehensions i define an empty list i tell it add x to the list now python is waiting for me to define what x is so i'll go for x in range 0 to 9 and that's it now this is something that many other languages don't provide you to do python is quite easy to use so you can do that here we only get 0 to 8 mainly because it has to be 10 like we did earlier and this works now this is just list comprehension but i can perform many other kinds of comprehensions so list is this let's say that i want to perform a tuple comprehension so for this i have to use parentheses and let's say that i want to perform a set comprehension and a dictionary comprehension all the data types that we have discussed so far could be all the containers that we have discussed so far for the data types could be used to perform comprehensions as we are about to do now comprehensions are quite easy to understand once you get through the basics so let's see uh let me just print all of them one by one so we will print the tuples then we will print the set and then we will print the dictionary so let me just show you um this is what tuple comprehension looks like what will it be for set just changing it to parenthesis will work now for dictionary we need a key value pair so let's say that we want to store key as the current number which is the number from 0 to 9 and the value as the square of the number which is number divided by itself so this is what it looks like now for a number to be key value where i want to define the key press colon and then define the value which is x multiplied by x now if i were to print it as you can see we get this we get a generator object and we get this and we get this so this is what it looks like the generator objects are quite easy to understand you can just let me type in comma press enter and this is where you will get it into error so don't do it this way but you could use tuple and now you press enter and you get a tube out of it so this is one of the problems when it comes to tuple comprehensions that you can't just use it this way right but uh this is what comprehensions look like they're quite easy for you to create once you understand how to create them and it's very easy for you to understand how to write code like this and it's just allows you to write such a code code that's easy to understand now that that is done let's see what else we have to do so now let's take a look at conditional statements so a conditional statement is basically a statement that allows you to change the flow of execution or the path of execution when provided condition evaluates to either a boolean value of true or false so suppose that we had some way of figuring out whether or not you're sick or you're healthy so what happens is let's say that you want to make a decision first thing is we ask you are you sick so let's say that you are sick then we would advise you to go to the doctor but let's say that you are not sick that means the condition whether you are sick or not evaluates to false and then you can go out and play football do whatever you want this is where conditional statements come into play and we encounter conditional statements every day during our lifetime we have encountered conditional statements i think you probably encountered condition statements today as well waking up uh when you're waking up you decide whether or not to sleep for an extra five minutes uh whether or not you are late for a meeting whether or not to take a cab or a taxi or a walk to the place that you work whether or not to eat at one place these are the kind of situations that allow us think of conditional statements in a more rational way so this is what it looks like we have many ways of doing this one is the if else statements so we the statement looks like this we have the if keyword inside that keyword that's a condition if that condition evaluates to true then statements one and everything before the else statement gets executed but if say the condition is false then everything underneath the else statement will get executed we'll look into it in more details when we are performing the hands-on but right now just understand if the condition is true then statements one is going to execute and if condition is false will execute the else statement which is the statements two now there are many ways you can construct an if statement depending on the logic that you're trying to build you can construct a nested if else statement you can construct if else and else if statements you can construct a lot of different kinds of effect statements so you're not limited to just use if and then else and then your uh conditional statement ends you can use if if this not true then if this is true then if this is true then if this is true then you can take a look at a lot of conditions that way or you can nest them one inside the other that would work just fine as well so now let's take a look at some conditional uh statements again we have the same setup we have an app dot py file py is the extension for the python executables or the python scripts that we write so to write it let's first take a look at conditional statements so there are a few keywords that we use in conditional statements keywords like if else and l if which is short for else if so let's take a look at this so let me define a number named x and it's equal to 20. now if i check if x is less than 20 then i will print x is less than 20 else and now else print x is not less or you could say x is greater than so now this is a statement but it's a little incorrect i mean it's not incorrect in the way the syntax is structured so if i write this it says x is greater than 20 and we know that's not true because x is not greater than 20 it's actually equal to 20 this is where the else if statement comes in so we can add multiple conditions and attach code to it that will execute when one of the conditions satisfied so if i type l if x is equal to equal to 20 and remember to put two equals mainly because we are not assigning a value we are trying to check whether or not a condition is correct print x is equal to 20. but on this again is correct this is where if lif and else come into play if for condition and a conditional statement will always start with if not with alif and neither will it start with an else then we'll check okay if this is not true else if this is true then do this and if this is true then do this make sure that you understand that only one of these statements will get executed so in no condition will it happen that this will also get executed and this will also get executed so if i were to do x is less than and if i run this it's still going to execute the first statement which is x is less than 20 even though the second statement is also true so make sure that you understand that and now let's take a look at nested elsif so so this is what it looks like again i could have made the same mistake i could just put equal and that would have caused the issue now nested else basically means an if statement and i want to check if x let's say x is less than 20 and is less than 15 as well and i put it so i will print something out there as well x is less than 15 and i can type in else i can write some code x is greater than 15 and finally else x is than 20 so if i run this x is less than 10 20 and x is less than 15 which is true now if i were to give it a value something between 20 15 and 20 x is less than 20 but it's greater than 15. so what's going on here let's take a look at the path of execution we take a look at we assign a value of 17 to x we check this condition we check if x is less than 20. it is less than 20 we go down we print x is less than 20 we go down we check x is if it's less than 15. it's also true so we go down and we print this we we skip over these statements because one of the conditions has evaluated to true we go down here and since that condition has also evolved to true it's fine but now if i type x is equal to 21 what do you think will happen just one statement gets printed because it comes here c is if x is less than 20 well x is not less than 20 so it just skips over everything inside if and moves to else and prints that and it's done so this is where nesting and nested if statements and else if statements come into play you can nest it uh really deeply but your code becomes really difficult to read if you can do it you can do it like this as well if x is greater than 15 or something like this and then again underneath that you can type another if but it makes your code really difficult to read so make sure that you understand the trade-offs when you're using if and else if statements now let's take a look at looping statements so a loop is a process in which we have a list of statements that execute repeatedly until it satisfies a condition so let's say that i want to print something 50 times instead of me having to write it one time and then copy and paste it 50 times what i can do is i can instruct my python program to repeat something or repeat printing something 50 times and that way when the condition the condition that is satisfied is that it has this statement been printed 50 times if it has then we print that if not if it hasn't been satisfied then we keep on looping and keep performing the task that is inside the loop and if we have satisfied the condition then we exit out of the loop and move on to the next statements so there are many kinds of looping constructs the first thing is we have a for loop so a for loop basically allows us to write code in which we can basically iterate over a lot of things so this is what the flowchart looks like we take a look at the variable and we check is there a variable in the list and if it does not have any variable that are remained to be performed the task on then we perform the rest of the code else we perform the statements we move on we perform the statements we move on and we keep doing that over and over and over again this is where the looping statement comes comes into play so then we and we'll have an example of this when we're performing the hands-on so don't worry if you don't understand it as of now then comes the while statement so the while condition is something that is also used in loops but the fundamental difference is while loop is used to loop over a bunch of statements in which what we're trying to see if there if a particular condition is true or not instead of looping over a particular uh list of things we can just use a while loop and loop over uh some things under a specific condition is true so here what we're doing is we're setting a variable a to 1 then we're checking whether a is less than 5 so 1 is less than 5 we print 1 we add 2 to a so a is 1 and 1 plus 2 equals 3 so now a is equals to 3 is 3 less than 5 no it's not so the condition evaluates to false and we print it so we print 3 we add 2 to it 3 plus 5 3 plus 2 is equals to 5. so a is now containing the value of 5 we check whether 5 is less than 5 that's obviously not true is equals to 5 so we end the loop and since there are no other statements left to be executed we exit the probe now when we're looping there are certain keywords that help us in the loop these are break and continue so what do they mean well the break keyword allows us to end the loop prematurely so let's say that i have a list of names let's say that i have a list of name from uh let's a list that contains alphabets from a to c what i want to do is i want to print everything in the list but if anything if the character in the list is d then i want to stop the loop i want it to not continue any further i want to just uh exit out of the loop anything after that is not going to be printed so this is what the break statement comes in and it's coupled with an if statement and we'll take a look at this in an example when we're performing the hands-on but now just understand that if you want to if you have a condition in which you want to exit a loop abruptly or prematurely before the loop has actually ended then you can use the break statement the continue statement on the other hand does something quite similar so you can take a look at the break flow chart as well if you are unfamiliar with what it's doing basically we check a condition can we check the brake condition if the brake condition is true then we break it and loop exit the loop if the brake condition is not true then we continue with the loop as long as possible again this is a bit esoteric so i'll explain it in the hands on when we're performing it with the code then comes what we'll try to do which is looping and using continue so continue does something similar to break but instead of breaking the entire loop what we do is we skip over that loop so let's say that i am again doing the same thing a list containing all the alphabets from a to z i want to print it they are ordered in any way that you like what we are doing is we are taking a look at the alphabets and the print take it off the screen but if the alphabet is d then we don't want to print it we don't want to perform anything that's being done to other alphabets so what we do is we take a look at it we see okay if the current character is d then we use the continue keyword and we skip over the rest of the statements that are used to execute the loop and we just move over to the next next character so that's what continue does and now we'll take a look at the hands-on in which we'll be performing uh tasks using all the keywords that we have discussed as of now let's take a look at some loops so again we are in our app.py file and i'll write some code for you to run to understand loops so we'll take a look at for loop and while the first thing i'd like you to see is we're going to be printing a number from 1 to 10 so let me just show you so this is a classic example of loop for x in range range is a pretty common function used in python if you've never used it get i i would suggest getting comfortable with it it basically means i'll explain the code in a moment so what we're doing here is we're instructing python that hey i want to loop over something every time the loop iterates i want the value to be stored in x and what i want is the range to be going from 0 to 10 minus 1 which is 9 always remember range is exclusive of the end so if you want to type 11 that will go from 0 to 10 so that is done now what happens is when i print x what it will do is it will start ranging from zero so it takes a look at zero prints zero it goes one increments it by one goes to one prints one two three four five six seven eight and it goes to nine prints nine and then it is out of range so it stops abruptly so let's see if i were to run this as you can see it's printing but let me show you a trick when you're printing something type the end equals comma right so in space so now if i print this instead of each thing being printed on its own line what's happening is it's going to print it uh with a comma and a space between the next element as you can see that's the reason why this is there's a comma and then space here as well so that is done and so this is how you loop over a range but let's say i don't want to loop over a range let's say that i want to loop over a list of numbers so nums equals 1 2 3 4 5 right or if you remember with comprehensions x for x in range 0 to 10 now we have all the numbers that we had earlier and this is what it looks like i run this again okay for oh for x in range and now it's doing the same thing so we have numbers here and for each number we are looping over that now that that is done one thing i can show you is after looping we can take a look at some of the statements that we had learned earlier so break and continue so let's say that i only want to print till four let's say that this is a shuffled list and i want to break the loop and not print 4 so if x is equal to equals to 4 then break else will print x so i do this 0 1 2 3 it encounters 4 and since the condition is satisfied executes the break statement gets out of it and the program is not ended yet if i want to type something below it i can type like this just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to winterpad to know the right answer now let's continue with the session done and it prints it there what's happening here is i have uh just as soon as i encounter the number four i just quit the loop so everything that's after four it's not being executed in the loop if i change break to continue notice what happens so we have zero one two three four is skipped then we have five six seven eight nine so what happens it takes a look takes a look at the number it's four and we continue we say we don't want to print 4 we move ahead so this is this is something that can be helpful let's say that you're trying to print something out of a list and you don't want to print the name of people whose salary is less than let's say 40k so what you can do if person let's say that for each uh x 0 index x dot salary is less than 40 then continue so this would have the same effect as it did earlier this is what it means so this is where we move on to the while loop so let me just define a number is equal to 10 and instead of 4 we'll use a while loop while a is not equal to 0 print a and then a minus equals 1 so if i run this it prints numbers from 10 to 1 in reverse order so what do you think uh is happening here so basically i have defined a variable named a and i'm checking whether or not it's equal to zero if it's not equal to zero then perform this task one thing that you need to make sure is if you're trying to check whether something is equal to something and if it's not then you need to manipulate it inside the loop if i don't do this then this will run forever as you can see it's keeping is going to keep printing on 10. i've interrupted it using ctrl c i don't want it to run forever so if i do this then it understand how to do this but it will take a look at the number it's 10 print 10 and in decrement 1 it becomes 9 9 is not equal to 0. 9 go ahead remove 1 8 not equal to 0 printed 7 and this is how we go till 0 we print 1 then we in decrement 1 which becomes 0 and we take a look at this so we go okay is 1 equal to is 0 equals to 0 that is true so we this statement evaluates to false which is not equal to 0 so what is happening is we are printing the things until this statement becomes true and when a becomes 0 this statement this statement becomes false and we move out so as long as this evaluates to true our loop is going to continue while or another way of reading is while this is true keep executing whatever we are executing so that's a while loop now why use while loop over for loop there can be many scenarios where you want to use for loops i like using for loops mainly when uh mainly when as you can see if i can travel back in time yeah so mainly i like using for loops when i have a list of values something that i can easily access in a loop like this this doing this with while loop would be a little difficult let me show you how so i would need to have an index start it with 0 and check while index is not equal to the length of nums minus 1 that is one way to do it or you can check if while index is less than nums value minus 1 i will print nums values at index and i will index plus equals one if i run this again it will do the same thing but i had to write a lot more code and i have to keep track of this index variable uh similarly uh python's for loop does all of this behind the scenes for us so we don't have to manage these external variables and all that for us there's advantages to this but if you want to uh make if you want to have access to the index variable then you can use a while loop or you can lose a clever for loop and well but for most scenarios when you have a list of values that you can iterate over using for loop is better and when you have working with a specific condition then using a while loop is better so it's completely up to you it's your choice whatever feels the right tool for you you can use that but i would certainly recommend using for loops for iterable statements so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills right now let's take a look at functions in python so functions are one of the most fundamental things that you need to understand when you're learning any programming language they allow you to encapsulate code and then you reuse it in many other parts we'll take a look at what that means and how you can accomplish things with functions but the first thing that you need to understand is that it's a very very very important topic and you need to get a really good grasp of how functions work before you can move ahead and discuss other things and learn other things in python so make sure that you pay attention and understand it thoroughly so a function is a block of code that is organized in such a way that it's reusable set of instructions and can be used to perform some related set of actions so it's used to organize a real reusable set of instructions that are used to perform some related actions so we'll take a look at what that means basically it means that we wrap up some piece of code that is entirely used to perform one thing and that is then used that wrapped up piece of code is then given a name which is the name of the function and then we use that name instead of copying and pasting the entire code again we'll take a look at what that means and how to accomplish this if you don't understand it as of now don't worry so there are two kinds of functions in python the first is a user defined function which is the something which is something that we create as developers as programmers and then there are some functions that are built into python so you don't have to create their implementation yourself python will have already done it for you so the user defined functions as i've already told you are created by users this is what the syntax looks like we use the def keyword def is a shorthand for define we give the function name we accept some arguments these arguments are basically values or things that our function will perform some actions on and then we do some calculations or any other kind of tasks that we wish to perform and finally and this is not a necessary statement but if you want to return something you can do that returning something basically means the this would be the result of the function now sometimes your function may not have any result to perform if that's the case then you don't return anything you just omit the return statement completely now give an example there's a function right beneath it that says def add is the name of the function you pass in two parameters a and b we create a sum which is equals to a plus b so anything that we have a plus b and we return the sum now to be quite honest this is a very trivial example but to understand how functions work we need to move our way up from really simple to complicated examples now there are many uh built-in functions as well these functions have already been written by the developer of the python language and they have created these functions for us to use so some of them are the we have an abs function which is used to store the absolute value of a number so if you have a number that is negative that is negative 17.4 then if you perform use the abs function on that you will get 17.4 absolute basically means it converts negative to positive or in other terms you can get an absolute value where you perform some mathematical operations on it then you get all and returns true if all items in an iterable object are true so if i have a list of state a list and all of everything inside that list is true then it will return true if any one of them is false then it returns false then we have any then we have ascii then we have bin which is used to take it look at the binary version we have bool we have many other functions min max whatsoever so you can use them if you wish to if you are trying to perform some tasks make sure that there is a instead of writing your own function make sure that there is a function available for you then there's lambda functions now this is a concept that gets overlooked quite often but lambda functions are very powerful so lambda functions are basically anonymous functions that have no name and it contains a single expression a single line of code is there in a lambda function so these are used to pass some tasks that we want to perform in a function let me give you an example so this is how lambda functions can drastically improve the size readability of a code so let's say that i want to create a function in the way that i have done as of now so uh i want to create a function called multiply so i can do it using multiply def multiply x comma y and then i return x multiplied by y but if i since you can see it's a very simple pro simple line of code i can simply just do r will be the uh variable that will be pointing to the lambda lambda will accept x and y as parameters and will return x multiplied by y now to call the lambda all i have to do is use the r which is the name of the lambda and i put parenthesis in outside and inside the parenthesis i pass in the two statements if i don't put a parenthesis then it would simply be a variable that holds something i'm not calling the function i'm not executing the code that's inside it so i pre pass into ln3 and i get 36 now another thing that lambda does really well is that it allows you to remember some things so let's say that i have created a function called def my function i pass in a number named n this number now will be remembered by the lambda that i have created inside that function forever so if i return a lambda in which i i will accept another parameter called a and what it will do is it will take that number and add n to it this way i can create multiple functions that do the same task but where the value of n is different and this is very trivial example but i'm very mundane but you can think how far you can take it there are many great python programmers who use lambdas in very clever way to write code that's very readable quite simple quite easy to understand once you understand what lambdas are and it's quite uh quite comprehensive take a look at a function that's so simple to understand so take a look at that as well now let's take a look at some functions and we'll implement some functions inside again we have the same setup here we'll define the function so let's say that i have some task that i want to perform okay and it has several steps and all of these steps will need to be performed regardless of whether where i execute the task this example will also show you the importance of functions so let's say that the i want to uh let's say i want to download file okay and url now i'm not going to actually download the file but i'll just print the steps so establish connection then these are the typical connection steps you need to perform when you're trying to download a file from the internet open the connection download data close connection so now if i want to download anything any file let me just print the url or another thing i'd like to show you is that you can add strings or concatenate strings so this way so if i do this then it will print establish space connection space and then add whatever url is right at the end of it open connection and let me print the url download data and close connection all right so if i were to call this function download file and let's say that the url is ftp colon forward slash over slash uh a www dot abc dot org now if i were to run this let me just run this here it's going to perform these tasks what the major advantage of using a function is now if i want to perform the same task over some other place i can copy and paste it into different files and it will do the same thing over and over again so if i were to print this as you can see it's done everything for me let's say that i want to change the uh url df i j k and if i run this it's downloaded it for all different purposes but now let's that i want to change something in this step uh before after downloading it i want to log it to the login to some place let's say i want to make sure that this is recorded in a database that i had downloaded this file so log to db and this is the url i downloaded it from now if i run this as you can see this change let me just uh so i've added two lines so this is what it looks like now it looks a bit clear let me clear the screen and run this again so that you can see and it's downloaded it but as you can see that this step is now added to all three of the files this is the advantage of using a function so whenever you want to make a change to some particular step some particular well-defined process you can just make a change in one place and everywhere that process is being performed those changes will be reflected there so if i had to add something else to the download file procedure this will be executed by all the functions or all the files that are calling the download file function that i have just described so that's one advantage and now let's take a look at returning some data right so let's say x comma y i get in two data and i perform some task now i want to return x multiplied by y let me call it again this is a very a trivial example multiply right and if i want to multiply two numbers multiply you multiply x and y now x and y are going to be numbers so let's say 15 let me 10 comma 15. now if i were to run this 150 would be the expected answer uh if i were to run 25 250 will be expected answer so we have gotten both of them but one thing to notice is that it's a really simple function so defining it like this is going to take a lot of time and it's really unnecessary so one way you can change it is you can write it like this let me just show you the code that was earlier there and i am just going to change it to multiply equals to a lambda that will take in x and y and return x multiplied by five run this again and this is performing the same tasks that we had performed earlier and it's printing the same thing that we had printed earlier so there's no change in functionality but we've changed the implementation so what is the advantage now this function i can send as an argument to any other function this is where it gets a little uh difficult to understand so let's say that i want to print let's say that i want to oh yeah one thing i can do is def create multiply and it will and give me x and y will be given to me on the time of execution so now what i can do i can return a lambda that will take y as a function and it will return x multiplied by y so let me just delete this now this works and now i will create multiply create multiply 10 and now i will just pass in 15 and 25 i run this and i get the same answer now as i've already told you that this is a function that you can pass into another function let's create another function named execute takes in a function and takes in an argument and all it does is that return calling that function with that argument so x secured 15 would be the other argument and f uh sorry multiply multiply and we want to take the cubed i run this again it's doing the same thing but it's doing it for me now i can make changes to it i can make basically log the calls to a console called f with and okay i've gotten an error yeah i need to convert it to string now it works so it called f with 15 and it called fv25 i can log this to a database to make sure that it's being executed correctly and so on taking a look at what are data structures so a data structure is a particular way of organizing and storing data in a system's memory so that it can be used efficiently for some purpose a good example of this would be an arranging data is a very important aspect of any programming language some kind of arrangement of data might be better for one process than other purposes uh to give you a more concrete example uh if i want to give you a few numbers let's say from one to ten let's say i want to give you ten numbers of any i were to give you 10 numbers and those 10 numbers had were given on a card all of those cards were placed face down in front of you and you had the option of arranging them in any way possible by looking at their value then i would ask you to check for a particular number to be existing in one of the cards so if i were to say okay check that the 10 exists in one of those cards what you could do is if you had arranged them all in a linear fashion in a random order you can just take a look at each card and see whether or not it contains the number 10. that's easier for you to do for 10 numbers but let's say that the scale increases and now you need to do that for 100 numbers for thousand numbers for million numbers and for even billion numbers that is going to be really time consuming on the other hand if you had stored it in a different way let's say that you had stored it in a way in which when you get the data what you do is you first take one card see if it is uh what the number of the card is place it someplace then take the other card and see whether or not it's smaller or larger than the card you had previously taken if it's smaller you put it on its left hand side a little below and in it and if the card is larger then you put it on the right hand side and you keep doing it again and again and again this forms kind of a tricky like structure in which a card is at the top all the numbers smaller than the card is on the left hand side all the numbers or larger than the number on the top is on this right hand side and this uh rule is followed on for all the cards so if you have many cards this will be followed for all of them then i can come along and say for the 10 million numbers that i have given you tell me if the number 15 is in those what you can do is take a look at the card right at the top if the card at the top is is larger than 15 which means 15 is smaller than the card at the top we look at the left left portion of the structure that we have created on the other hand if it's larger then you look at the right portion and you keep repeating the step each a step is going to cut down half of the tree for you so you don't have to worry about that so this is what's called a tree data structure in essence and this is specifically called a binary binary search tree and the technique we're using inside it is called if binary search algorithm basically if you have data that is if you have data that is sorted in a particular order you have the ability to look at the data that's right in the middle of the deck figure out what the number is if the number you are looking for is smaller than the number then you have to discard everything that comes after that card the middle card that you've chosen if it's larger than the number then discard this and everything that comes before it and you keep doing it again and again and again and you will eventually get to the card that you choose in very few number of steps in fact the number of steps is different from linear to logarithmic scale so it's quite different so this is one of the ways that storing data in a particular way can help you similarly you can if you wish to grade a few papers you can store them in a stack that's easier for you to deal with and if you're trying to manage a few people getting through and doing things in an orderly fashion you can store them in a queue similar concepts are carried over to data structures as well right let's take a look at what is a linked list so a linked list is a linear data structure now a linear data structure basically means that data inside this data structure is stored in a linear fashion uh linearity basically means that there is an order one data comes a point comes after the next data point and that comes after the next data point so this is how linear data structures work the most common and famous example of a linear data structure is an array or a list in python if you have used other languages such as java and c plus plus then you are using arrays and those have linear data those are linear data structures as well so each element or node in a linked list and node is by a node is a term that we use to define a particular data point in our data structure which is linked list so node contains two things for two pieces of information the value that we want it to hold and a reference or a pointer to the next element now that pointer could point to the next element if there is one if there is no next element it points to none in python none basically refers to an absence of value so this is this piece of information comes in handy which we will take a look at when we're implementing the linked list so as you can see that a linked list we use node now node is one way to refer to what we are describing you can use other terminologies such as elements or any other thing but node is what the community has settled down that's the keyword here and it uses reference or pointer for the next element now the reason why we're using the word reference and pointer is because depending on the language you call them different things in java and in python you use reference which basically means you ask for the address of an object in memory and it will be given to you by the runtime environment on the other hand in languages where you get to manipulate the raw internal memory of a system such as c plus and other languages you can use pointers pointers also allow you to do arithmetic on the addresses where you can add a few things and get the next address but that's not possible in references in any case you can implement these data structures in any language that you desire whether it's python whether it's java whether it's c plus plus whether it's any other language you can use them in all of those right so let's take a look at the benefits of using linked list so a linked list using a linked list has several benefits the first one is that it is dynamically sized a dynamically sized linked list basically means that it is a list in which you can add as many as much data as you can or as many nodes as you want to as long as there is space in memory for you now you might be wondering that that's also the case with arrays for lists in python and we'll get to that in a moment but since lists are also dynamically sized there is one tiny bit of problem with lists that will discuss later on but uh the important aspect is that they are dynamically sized now similar concept to list in java and c plus plus and other statically typed languages is arrays arrays are not dynamically sized they cannot be sized dynamically they only have one type and you cannot add more data to it after a button a certain point you have to define the capacity of an array when you are declaring it and when you are instantiating it in c plus and java if you have created an array that can hold 10 memory items you can't add 11th one that would be considered an illegal operation and that will cause your program to crash just know what the error is and how you can use how you can use linked list to solve those errors arrays are not bad they are used for specific purposes and if you want to only store 10 memories then using a linked list is just an overkill so understand the problem and then use it in any case linked list can be dynamically sized it allows for faster insertion operations so let's compare it to other data structures such as arrays as that's the only one we know right now in an array we have let's say we have a million elements and i want to add something right at the beginning of the array even though it might be dynamically sized what i would have to do is assign firstly grow the size of the array so from 1 million it should now be able to store 101 million and 1 element then i have to shift all the elements one place back so the element that was at the uh that was at the millionth place now needs to go to the million and first place and that way we need to shift all the elements available just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session and then all i have to do is rewrite the element that is you know the zeroth index at the beginning similarly if i had to do the same thing for any other place in my array such as the tenth index fifteenth index seventeenth index i would have to do the same kind of process just i would have to stop at the tenth index and not go till the end now that's useful but uh as you can see it's quite inefficient i just want to add one element at the beginning i that's not what i want to do so in linked list you can do it quite easily since in linked list all you have to do is just create a pointer point its next pointer or reference store the next reference to the beginning of the list and point the pointer that's pointing at the beginning of the list to the current pointer it might look uh sound very typical but don't worry we'll take a look at that in the demo so you don't have to worry about that that's the way it works so this is why insertions are much much faster in linked lists this is why link lists are preferred in situation where we have data that is being dynamically added so we need to figure out where we want to add it and how we can do that next let's take a look at master deletion so again it's the same problem if i wish to delete 10 elements from my array at random points and i want to shrink the array now i have to firstly remove one element string of the array from the back then do the same thing again and again and again that is also quite inefficient in linked list all i have to do is just make sure that there are no dangling pointers that means that if i'm removing an array or i'm removing a node i just want to make sure that the node that is occurring previous to the current node and the node that's occurring next to the next node are connected to each other that's the only thing that i need to take care of other than that we just have to remove the data the rest all we all will be managed by my either my the garbage collector or it's something that i would have to take care of on my own now again depending on how you are implementing these structures you can implement them in several different ways but it generally leads to a faster deletion time then comes memory utilization now many data structures need contiguous blocks of memory in linked list you don't need continuous blocks of memory so for instance if i want to uh store 10 million data points or 10 million nodes of link list i just need to find 10 million small small patches of memory where i can store my linked list item and the rest i can just point to the memory address of the next element in each of the node and it will work just fine on the other hand the memory utilization is not going to be great in arrays because in arrays we have a lot of uh we need to have contiguous blocks of memory this is how arrays are implemented underneath the hood this is also why we need to define a fixed uh size right at the beginning because it's more efficient that so when we have an array and we want 10 million data points what we need to do is we need to firstly find out if block of memory in which i can store 10 million data points and assign that block of memory that block of contiguous memory to my program so that it can add 10 million arrays 10 million indexes inside my array inside my memory now that's easier for us to do but it causes a lot of overhead for on our memories part because let's say that there are few patches of memory that can store 2 million 4 million and 4 million again now for our memory to be able to be used by arrays our computer or our operating system would have to defragment the memory which basically means just rearrange the memory in such a way that all the uh empty space is patched at the bottom so we can easily use this again that takes a lot of time and could hang our computer and could lead to degradation in our computer's performance and speed so let's take a look at how we can fix something like this so we use linked list for that but before that let's take a look at lists versus linked list so what is the difference between a list and a linked list list is a python programming construct so when we're talking about list we're talking about the native python implementation of a list and a linked list is going to be something that we will be implementing in a few moment steps in python we already have a built-in data structure named list but it is a little different than linked list so although it might seem that the internal implementation pythons list might be the same as linked list mainly because we are using dynamically sized data linear data structures there's some key differences a list is stored as a contiguous block of memory while a linked list is stored as a bunch of nodes scattered around memory connected to each other so if you want to store some small pieces of data then you can use lists but if you are going to store a large bunch of data and you need to be able to dynamically size it and want to add and remove data continuously from it then you can use instead of using next you can use linked list linked list is much more efficient for that purpose you can use lists for that as well but the memory consumption is going to be high and it's going to lead a degradation of performance so it's up to you which one you use you just need to understand how to use or in which situation to use which one both these are tools understanding which tool to use when is going to be really going to be the key to building good software so now let's take a look at the types of linked list so there are many types of linked list since linked list is a very versatile language you can we are going to mention only three of the most used types of linked list but you can use other kinds of linked list as well the first one is simply linked list in a singly linked list we only share a single reference to the next one so basically what it means is that we have a data point that contains or a node that contains some data and reference to the next element if i go to the next element i can't go back to the previous element there is no uh dual connection it's just a single line of uh traversal so this is what a singly linked list is then comes doubly linked list in a way link list we have both pointer to go from current to the next node and from the current to the previous node so that way we can traverse both front and back in our data structure so these are two different kinds of data structures and then there's circular linked list in which the last element of my node is going to point to the first element so that we have a circular linkage instead of storing it in a linear fashion in which we have the beginning and the end we have instead of having the beginning and the end we have a circular structure now all of these can be used for their own purposes in single linked list we use data structures to implement a single data point these are called nodes the main important aspect that is different from singly and doubly is the memory usage the memory usage of the doubly linked list is going to be significantly more because it's storing three pieces of information not two whereas in single linked list you're only going to be storing the data and the reference to the next element or next node so that's the thing now another thing is that they are used in different things so simply linked list can be used in the uh back and forth feature it can be used to develop stacks which can be used to develop the forward and backward features in web browser so when you visit a browser then you go forward then you go backwards and you go to another address then you go backward and then you go forward all of this is implemented by single linked list and it's quite easy to do it with doubly linked list in singly linked list it's a little difficult but it could be done if you do it using stacks on the other hand in doubly linked list you can perform many different kinds of things as well and circular linked list can be used for developing caches something that is called lru or least recently used cache and that's one of the most important implementations of circular linked list so you can use it that way and you can implement circular linked list using singly and w link list which basically means using a single link or double links double links means something that points to both the current next node and the previous node as well so you can use it that way as well now let's take a look at a demo of implementing links list in python so as promised i have a jupyter notebook and here i'm going to implement the linked list so you don't have to worry about how i'm going to do it just follow along with the code if you have jupyter notebook with you you can do it quite easily so jupiter notebook is not really necessary in this case you can also write the code inside a simple python file and then run it i'm using jupyter notebook because it's easier for me to show how things have been implemented since we need a node the first thing i'm going to do is you know implement a node so just create a class call it node that node class needs to have in any a constructor in python a constructor is called an initializing method call itself in the self method inside the cell after the self keyword i need some data and the next pointer and ext should be pointing to none as you can see in jupyter notebook this is highlighted as green because next is a keyword in python in case you don't wish to use the next keyword you can use something else some other keyword that makes sense and you're going to use it here it doesn't really make much difference here but you can use it for something else as well and by default it's none so if there is no other point that is given to us it's going to be next so now all i have to do is just give it some data and also i can use the data to be done as well so it just doesn't contain any data and now self dot data is equal to data and self dot next is equal to next and that is the so that's our node class this is what is going to contain a single data point if i run this i don't see any error if i were to create a new data let me call it n1 and i don't do anything press n one dot data run it doesn't print anything if i press n one dot next doesn't print anything on the other hand if i were to pass in one and if i were to print and one dot data it contains one and if i were to pass in as the next element in new node with the value of two this is one and one dot next would give me the address and i want the data here and that's no and i can do the same thing again and again so here after this i can do it node 3 this is what it looks like and i can go to the next element and it's this so it's quite easy to use it that way but we want to do it in a little more efficient manner so all i can do is i can implement it using a linked list now inside the linked list i don't need to inherit it from any other class here i am initializing it and i all i need is self so self and you can call it anything many people call it start i call it head so head is going to be the element that is pointing at the beginning of our list if head is null which means there is no beginning that means our list is empty and if your head is not none that means that there is some element at the beginning how many elements are there that can only be determined by going through the entire list but we know that there is something at the beginning that's all you want to do so with that we have created the initializer or the constructor function now comes the mate of our application here we have to implement the insert function or the insert method since it's inside a class first parameter is self second parameter is data now comes the interesting aspect so what we do is we create the new node here so it contains the data and the next pointer is going to be pointing to nothing now it is up to you how you want to implement it what many people do is that they create two separate functions insert front and insert back now this depends on how you want to implement it i want to keep this simple so i'm just going to call it insert insert front and insert back basically mean i want to insert some data at the beginning of my list and insert back would mean insert some data at the end of my list depending on how you wish to implement it both are valid written just understand why you want to implement it at the front or at the back now all i want to check is what if self.head is not none now i could simply just do this if self.head that would lead to the same thing but i want to be more explicit here so basically means if there is some value in the head the head is pointing that means the our list is initialized and there are some elements already there and i want to put it at the end all i have to do is i have to current is equal to self dot head while current dot next is not none so all i'm checking is so i'm going to go to the next element till i don't reach the end so right at the beginning of the end which i'll show you current is equals to current.next so what i'm doing is let's say that i have a list in which i have one that point to 2 but 0.23 let me just make it a little easier to read now what happens is i take a look at the head head is going to be pointing to one from here i take a look at the head and i understand that there are elements here so i assign this to current which is here and then i keep checking does it have any uh next element it does so i go to the next point which is here current is equal to current dot next and i check if there's some element after it there is so i go there then i check if there's some element after it there is not so current is currently pointing to the end of the list right so after reaching this all i want to do is current dot next is equals to new node so let's say the new node is 4 now current dot next is going to be equal to 4 in actuality it's going to be pointing to none here so i'm thinking if the next element is not none then move ahead it is none so i'm going to go to 4 and its next element is now and now we're done so this is how this is working we have inserted an element when there is no element present inside our uh when there is some element present inside our list but what if there is no element well then we can just basically do it this way health dot head is equal to new node and we're done i'll have to add an else clause here and better so we have created the insert function now insertion is fine but what if we want to print the list that is where we come here so left print list and i don't need any argument other than self current is equals to self dot head and while current is not none all i have to do is print current dot data okay so this is done now all i have to do here is create a linked list which i can call it anything i'll call it list or for simplicity sake i'll just call it l link link list i have created an object of linked list which means this code ran completely this this portion of it now i have to insert some data here so l dot insert one that works two that was three that works as well so as you can see i didn't have to define a particular size the size is being automatically generated for me it's automatically being increased in its size now if i print the list as you can see that it is going on uninterrupted right that's a problem so let me just call cell dot and this is a problem that we're going to see in a moment restart and clear output is going to be the one this is also one of the reasons why i choose jupyter notebook and now let's take a look at why this feels and the reason is quite simple because we have not uh moved ahead in our list what happened is after we print the data we want current music equals to current dot next this is a mistake that many of us make many times what's happening is printing the current data and we're going to the next value and we're checking okay now am i uh pointing to nothing if not then that means there is some data left to be displayed so i'll just rerun it again from the start link this insert insert and print and as you can see it's being printed correctly now if i want to print it entirely on one line i can just and now it's done so this is what it looks like as you can see it's not really difficult to implement it's basically 15 lines of code creating insertion and printing you can also delete the nodes there's many different articles and different ways of doing it also and now i'd like to show you how you can implement a doubly linked list so we'll implement it from scratch again so that it gets settled in your memory uh to implementing a doubling linked list you have to implement it the same way you implemented simply linked list firstly you have to create a node that's going to be little different from the singly linked list node and i'll show you why hopefully you remember why but let me just show you anything so we need self then we need data which could be done then we need the next pointer which is by default none and then finally we need the previous pointer which is going to be equal to knowledge square and this is the crucial bit of difference we don't we didn't have this earlier so now all i have to do is just self dot data is equal to data and do the same thing here self dot next next in self dot previous this is to please run this this is working now let's just check if it's working correctly before moving ahead node data is one okay so i print n dot data this is what it prints now i want something to be before and after this right let me just do it this node one node two this is going to be this or we can do it this way you can create three nodes two and three and one n two and eight so n one dot next is going to be n two so right now what we have done is this we have created three nodes n1 which is one which is pointing to one n2 which is pointing to 2 and n 3 which is pointing to 3 now what we want to do is yeah we want to convert it to this n3 plus n2 should also be pointing backwards and n3 should also be pointing backwards this is the whole reason why we do w link list so n1 should have a reference to the n2 n2 dot previous should have a reference to n1 so this could be done then end to next should be n3 and n3 dot previous is equal to n2 if i do this now if i want to print n one dot data prints one if i were to print n one dot next dot data i have an invalid syntax address here and three now if i were to do it if i want to go a step back i can just do previous you should print two and again actually previous it should print one that's how that looks like now if i were to do this here's uh if i want to implement it in a doubly linked list all i have to do is type class doubly linked list def init we pass in self and that's about it what we need to pass in the implementation is going to be quite similar it's just going to be one piece of difference which i will highlight by default it's not pointing to anything oh it is working nav insert to insert something what we need is the reference to sell and some data so all we have to do if health.head is not done which means that the there is some value in self.head then all we have to do is firstly we have to create a new node as we had done earlier with the data and now if there are some values first we have to get to the end of the data so current is equals to self.head while current dot next is not none patent is equals to current dot next and we keep doing that once we reach till the end we make current dot next to be equal to new node and now comes the new bit new node dot previous is equals to current so what happens is let me just visualize it for you uh as we had done earlier let me just use this so we have the first node which is head it is pointing to 1 let's say which is pointing to 2 which is also pointing backwards right and now we are here just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pad to know the right answer now let's continue with the session the next of two is pointing to none that's far we create a new element which is three so we go here we remove it with three and we create the previous pointer to be pointing to two this is what we're doing right so it's easy to understand and this is we can do it very easily but if there is no element then basically all we have to do is self dot head equals to new node quite simply the same code that we had earlier and similarly all we have to do is call the print list function pass itself while and also we can current is equal to self.head and just check if current is not none we print current dot data and we go to current next point run this we have run into an error which is if self.head is not none we are running into an error in line number seven so it's here let's see what is the issue is not none not in not none that is the issue so now we have come up with the issue now let's create a new node let's call it l again and i'll call it doubly linked list don't need to pass anything l dot insert one now we want to insert two now we want to insert three and now all i have to do is go go through the entire thing as we had done earlier so l dot dot data l dot head dot next dot data l dot head dot next dot previous so we go one step forward and then one step backwards so print one which it does next next auditor three previous dot data and should do so as you can see we have a way to move forward as well as backwards here as well so that's what w link list is uh you can do other things as well deleting items here is going to be a little tricky so just make sure that you have access to the previous and the next notes and that way you can take the previous nodes next pointer pointing to the current elements next and the next elements previous node should be pointed to current elements previous node and then you can just remove the data that you have it's very easy to do quite easy to do in many ways so we're done here so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so what are these operators well these are some specific character which have a specific task to perform and based on the function and the task the operators are further segregated into seven different types of operators arithmetic operator assignment operator comparison operator logical operator bitwise identity and membership operator fine so let me discuss them one by one so starting with arithmetic operator well arithmetic operators are the one which is used to perform some arithmetic calculation so what it does it takes two operand to perform operation on them for example two plus three so here two and three are operand and the character plus over here is nothing but arithmetic operator all right so uh there are other arithmetic operators too like plus minus multiplication division mod all these characters are part of arithmetic operator let me just show you one more example like one plus two so you have one and two are the operand and plus here is a arithmetic operator one minus two again minus is a arithmetic operator two mod one mod is what arithmetic operator all right let's move ahead next we have is the assignment operator well this assignment operator is used to assign a value to a variable the character which comes under this operator r equal to plus equal to minus equal to multiplication equal to and etcetera for example you declare a variable as var equal 10 so this equal to is your assignment operator and is used to assign value to a variable let's get back to our jupyter notebook and learn more about it so for example i am defining a variable var equal 10 so this equal to is nothing but a assignment operator where plus equal 10 again an assignment operator but what does this mean so what does this mean well it means that var equal plus 10 all right so if you print the value of where what do you think the output should be well you'll get the output as 20 since the value of r is already 10 so 10 plus 10 it's 20. so the updated value of r is 20. similarly you can perform var minus equal to 10 and again get your value printed so again the updated value of r would be 20 minus 10 10. so this plus equal to or minus equal to it is generally named as a shorthand which means add or subtract and assign value to self all right same example is mentioned over here like a equal 10 a multiply equal to 10 so it means that a equal 10 into 10 when you print a you'll get the output as 100 all right so next we have is comparison operator well it is used to compare two values and it returns true or false as the output all right the operators which are a part of it are less than greater than less than equal to greater than equal to or not equal to for example let's see what example we have up here a equal 10 b equal 20 a is greater than b obviously 10 is not greater than 20 right so it is giving me false as the output all right fine so let's move ahead next is the logical operator well these logical operators are used to perform some logical calculation and the operators or the keywords which are a part of it are and or and not for example we have a equal 10 is less than 10 and 2 is greater than -1 then printing so you are getting output as false okay let's jump back to our jupiter notebook and see why we are getting the output as false so you had a equal 10 is less than 10 and 2 is greater than minus 1. so if you see we have 2 comparison operator up here so what is the value of 10 less than 10 since it is a comparison operator so it will give me a false right 10 is not less than 10 and 2 is greater than minus 1 this is true so you can summarize this as false and true all right so since it's false and true therefore it equals to false well how well do you remember the binary calculation that you have learned in your college it's like 1.1 equal 1 or 1.0 equals zero or one and one equal one or one and zero is zero so consider true as one and false as zero so false and true is false all right that's why you got the result as false now if you print the value of a you'll get the output as false alright so next we have is the bitwise operator so this operator is used to perform the bitwise calculation this operator includes and or left shift right shift not all right so let's see their use one by one let's see the example what we have up here so we have seven or five the output is seven seven and five the output is five so how do you think we are getting this output let's see the calculation so how it is calculated so if you convert 7 into its binary form it's triple 1 and if you convert 5 into its binary form it's 1 0 1. now if you are performing or so basically you are performing a binary addition on it and if you are performing it and you are performing a binary multiplication on it all right so let's see so if you are performing a binary addition on it so 1 plus 1 is 1 1 plus 0 is again 1 and again 1 plus 1 is 1. so that's why you are getting the order of 7 and 5 as 7. even you can verify this using the calculator open a calculator yeah it's a programmer calculator so seven or five so you'll get the output as seven that's correct fine next operator that we have got up here is tilde operator or the not operator well this operator is used to perform a not operation so what is not of 7 what is not of 7 it's minus 8 right how it is minus 8 let me just show you using a notepad let's open notepad okay so 7 in its binary form with 4 bits what it is 0 1 1 1. all right if you perform a not of 7 that is not of 7 what you will get all the bits would be switched like 0 would be converted to 1 again 1 to 0 again 1 to 0 so you will get 1000 and automatically a negative sign would be added at the beginning so you will get minus 1 000 in binary form which you convert into decimal you'll get it as minus of 8 all right that's why the output of naught of 7 is minus 8. fine next is the left shift and right shift operator let's see what is the output first for example i am trying for a right shift then 10 right shift 2 what is the output it's 2. let's see how we got the output as 2 open our notepad let's remove this so 10 in its binary form what it is it's one zero one zero all right well when you're performing the right shift you're telling the interpreter that you want to shift your bits toward right and how many bits you want to shift is basically 2 since you have mentioned 10 right shift 2 all right so 1 0 1 0 shifted 2 bits to the right 0 0 and remove 1 0 from the end all right so this is how you are shifting two bits towards the right so you got the result as zero zero one zero so now if you convert this into decimal form you'll get the output as two fine so it's like you're trying to push two bits from the left towards the right is it clear all right fine let's move ahead next we have is 10 left shift 2 what is the output it's 40. let's see how we got that output again 10 in its binary form is 1 0 1 0. so when you are performing a left shift it's like pushing the beds from right towards the left so 10 left shift 2 is like 1 0 1 0 and you are adding 2 bits in the end since you are shifting 2 bits to the left so you are getting one zero one triple zero so let's convert this into its decimal form so one zero one triple zero in its decimal form is what 40. so that is why you're getting the result as 40. so there's a shortcut trick well the shortcut trick is that just add zeros equal to the number of bits that you want to shift towards the left all right for example i want to perform ten left shift three so my output should be one zero one triple zero and one more zero all right since i'm moving three zeros all right since i'm moving three zeros towards the left so let's convert it so it's 80. so you are getting the output as 80. let's verify it again well if you perform 10 left shift 3 you'll get the output as 18. fine well i hope the bitwise operator is clear to you guys well in case you have slightest doubt please add your doubt to the comment section below and we'll try to reply them at the earliest for now we can just move ahead to the identity operator well these operators are used to test if two operands shares an identity the operators which are part of it are is and is not these are basically two keywords all right for example what we have up here x equal 10 x is 10 it's true or x equal 10 x is not 10 it's false all right it is just used to test if the operand shares an identity or not all right so next and the final operator in python is the membership operator well this operator is used to test whether a value is a member of a sequence or not the sequence may be a list it can be a string or it can be a tuple i know some of you guys might be thinking what is this list or what is this tuple and guys i'd say that just be patient i'll teach you about them in detail during this session for now you can just understand that this list is almost same as array which you had already studied in c c plus or java it's almost same as that all right and this membership operator it is used when you want to check if a certain element is present in a list or not so let's see what are the operators which are a part of it so well we have n and norton keywords which are a part of this membership operator all right let's see an example so what's the example up here so we have defined a list or you can see we have defined an array which consists of dog cat and wolf so we are checking for line and pets since pet is the name of our list or an array you can see so we are searching for line and pet so since there is no line in it so the result is false next what you are doing we are seeing for wolfen pets so yeah wolf is present in pet so we are getting output as true all right so this was all about the python token so moving on ahead we'll learn about data type in python well python has majorly two data types immutable data type and mutable data type immutable are the one which cannot be changed or modified and mutables are the one which can be changed alright immutable data type consists of numbers strings and tuples on the other hand mutable data type they consist of lists dictionaries and sets all right so let's discuss about them one by one starting with numbers so under the topic of numeric little i have already discussed that python has four different types of numeric literals integer long integer floating number and complex number well i have also told you that you don't need to specify the data type of a variable while you are declaring it remember python would automatically convert a number from one type to another if it need fine don't worry if you want to explicitly convert one data type to another you can do it using end function long function float function or complex function all right you have that option available with you for now let's just move ahead and see how we can find the data type of a variable let's see suppose i'm declaring an integer variable a equal 10 let's define a name as gel now what if i want to check the data type of these variables so how can i do that so for that we have type function so print the type of variable a all right or print the type of variable name or print the type of variable salary fine executed sorry there's a typo let's type all right so you can see that variable a is of type integer variable name is of type string and variable sally is of type float fine all right let's get back to our tutorial so this was about the numbers next is strings well anything which is written under the single or double quotes is treated as a string all right let's perform some operation on string and understand them in detail suppose i have first string as hello world and my second string is intellipart all right now what if i want to print first character from the string1 and the last character from string2 so how will i do that let's see so what you can do print str1 and i need the first character so my first character is at index number zero i'll just mention str1 of zero and i want the last character from string2 right so print str2 so if you want the last character just specify -1 executed so you got the output as capital h and small t since capital h is the first character from string one and small t is the last character from string two all right so now what if i need to extract hello from hello world so how will i do that what i need to do extract hello from hello world so all you need to do is print from with string string one hello starting from zero and it should until zero one two three four it should until five all right and execute it so you'll get the output as hello fine this is how you can collect the substring from a string one thing to remember is that if you check the index number of hello so it would end at 0 1 2 3 4 4 right so when you want a sub string so you have to mention it as plus 1 so 4 plus 1 is 5. so 0 till 5 it won't include the fifth position generally if you are extracting a substring the last number which are including that thing is not included it means that everything which would be between 0 and less than 5 would come as the substring all right let's perform some operations on it so first we have is the find function so what are these fine function well this find function returns the position of the string let's take an example for example i have a string as str equal attachment and what i need to do i want to find the position of the substring me from it so str dot find and inside that just mention what you want to find like i want to find the position of me let's execute it so you got the output as 6 why since me starts from six zero one two three four five and it's on sixth position so that's why you got the portion as six next is replace well this replace function is used to replace one character or string with other fine it's like what if i want to replace this me with m so str dot replace what i want to replace first mention that i want to replace m e with what i want to replace its m fine executed so you got the output as attachment att ach mnt fine me is replaced with m one more thing that you can do up here is let me just show you you can convert the word attachment into attach let's see how attach dot replace so what you need to replace from here is m-e-n-t you don't want m-e-n-t from here so what should you replace it with you can replace it with space that's it if you execute it you'll get the word attach what if i don't mention the space up here so you'll get the output as attach even that work all right fine next we have is the split function well this function is used to create split on the base of a character for example i have a split string which consists of word one comma word two comma word three so all these three different words are separated by comma so what i want to do i want to split the entire string on the base of comma so i'll write split str dot split on the basis of comma and execute it so as you can see i got the output as three different words word one word two and word three let's move ahead next is the count function well count function returns the count of the character in the string for example let's take a string as str3 equals intellipat now i want to find the count of letter i from this particular string so str 3 dot count i'll mention i let's execute it so what do you think the output should be i n t e double l i p double eighty so do you think it should be two well according to me it will be one i'll tell you why see the output is one because uh well remember i told you python is case sensitive so both the uppercase and lowercases are treated differently so if i am searching for small i that small i is just appearing once so i got the count of small i as 1. now what if i convert the string to uppercase dot u dot upper let's convert it to uppercase okay that's it str3.upper so it gave me intellipaat let's store it in some variable like str4 equal str3.upper fine now if you count the number of i's in str4 we'll get the output as 2. why since in capital intelli part you have two eyes all right fine so we discussed about the upper which converts the character string to the upper case fine next is the max or men function well these functions are used to return the max or main ascii values for example let's take a string 5 as anything for example exclamation mark at the rate hash one two three capital a small b small a c capital c alright so this is my string5 now i want to find the maximum ascii value from it so what i'll do i'll just write max str5 executed i've missed to mention this put it under the quotes execute it so the character with maximum ascii value is small c all right or what if i want to find the minimum ascii value from string 5 let's check for that so minimum ascii value and string 5 is of exclamation mark fine so let's move ahead so well next we have is the tuple tuple are a group of values within the parentheses and since they are immutable data type so the values within the tuples cannot be changed for example we have defined a tuple up here as my group equal a b c and d all right so this is the example of a tuple so let's move ahead and perform some operations on it to understand it in detail let's get back to our jupiter notebook let's define a tuple as my tuple equal within the parentheses i'll mention a and b then c and d all right so this is my tuple so the very first function that we are going to perform on it is concatenation so what are these concatenation it is used to add two strings or character all right basically concatenation is used to add two or more tuples all right for example i'll define another tuple as my tuple 1 equal e and f so if i need to concatenate it i'll just write my tuple just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipaat to know the right answer now let's continue with the session tuple 1. and let's print it print my tuple let's see the output you got the error as invalid syntax what is the invalid syntax up here something is invalid here let's define it again okay the semicolon is missing up here fine executed so yeah so this concatenated me and gave me the result as abcdenf so this is how concatenation is done in tuple concatenation next we have is the repetition repetition is used to duplicate the string or character for a given number of times for example what if i want to double the contents in my tuple so i'll just write my tuple multiplied by 2 and again that's it my tuple multiplied by 2 and hit enter so you'll get the output as double values of abcdenf fine so this is how a reputation is done in a tuple so let's move ahead next function that we need to perform is indexing indexing shows the index position of a character or a string within the group or within the tuple for example i want to find what character is present at the index number [Music] one so i'll just write my tuple of one so at first index b is present over there it's like a is present as zeroth index b at one c at two d at three and so on fine so this is how indexing is done in tuple next is slicing slicing shows a specific set of index character or string fine for example i want a specific set of strings which lies between the index number one two four so my tuple i want a specific set of string which lies between one to four so this is my zeroth one two three and four fine so i'll get the output as b c d and e let's check it so i got the output as b c d and e fine all right so let's move ahead so next we have is the list list is a sequence of mutable python data type which is defined within the square brackets and now since they are mutable they can be easily changed let's move ahead and perform some operations on it and understand it in detail so what is an example okay so we define a list as a 10 7.12 and data so it is consisting of mixed data type values it even has an integer a float and a string fine let's get back to our notebook and define a list so this is my list my list equal within parentheses a string a number a decimal and a string with multiple character fine this is my list now let's see what are the operation that we need to perform on it first is concatenation well again the concatenation is same as the one which we learnt in tuple it is used to add two or more lists together let's define another list as my list two my list two consists of element as let's take python or it consists of it consists of an integer now what if i want to concatenate my list with -2 so what i'll do my list plus equal my list 2. let's see what is the result let's print the value of my list so you got the result as a one two three three point one four john python 20 python 20. so you've got this result two times because yeah i executed it twice it's my fault so what you can do you can just my list dot remove hold on i don't want to execute this entire list or statement so i'll define it under different block so my list dot remove remove python okay i've misspelled python as okay remove this again remove this and remove 20 and again remove 20. if you're in remover you'll get an error fine so see what we have currently in my list let's print it okay let's get back up here and execute it just once okay so as you can see my list got updated with python and 20. fine next is repetition well repetition is again same as tuple it is used to duplicate your list with n number of times well next is repetition it is used to multiply your list by n number of time for example my list into 2 would duplicate your list with each element appearing twice in the list all right fine next is slicing again same as tuple if you want a specific portion of a list we can just mention the starting index number and the ending index number plus one and it would return as the sliced list all right for example uh as you can see here on the screen we have my list and inside that we have a1 3.14 and python and we want a sub list from one to fourth index number like one two three zero one two three plus one fourth won't be included so we'll get the output as one three point four and 3.14 and python all right next is append well appending is adding any value to a list it's almost same as the function what we did up here right it's like my list dot append and add any values with which you want to open like i want to append with 10 and print my list that's it so as you can see we got 10 in the end fine so moving on ahead next we have is extend well again extend is another function which is used to concatenate two different string all right example i'll define my list three as c and d and i want to append my list with my list three let's print and see what result do we get so as you can see up here c and d got added with my list fine well next is insert well using the index number you can specify any value in between the list for example i want to insert a number before 3.14 so i'll write my list dot insert i'll mention the index number my next number is 0 1 i want it after one and what value i want for example i want to insert a 20 30. all right let's print my list and see what is the result uh you cannot use a string up here you just have to mention the number index number so yeah you got my list at first position so what if i want to insert it before 3.14 that was my target right now your updated string is this 0 1 2 3 so you want to insert it at third position and you want to insert 40 so at third portion that is 0 1 2 3 so after 1 2 3 40 would come so after 1 2 3 40 is up here all right so this is how you can insert any number at a given index number so this was all about list i hope you understood the difference between list and a tuple if not let me just summarize it again a tuple is immutable while a list is mutable open and closed brackets are used when you are grouping items under it and in the case of list square brackets are used fine so this was all about the list so let's move ahead and discuss about dictionaries well these are more flexible data type in python and you define a group within the curly braces fine while defining the elements in a dictionary you have two elements key and its value fine or in other words we can say that we define an index for each element let's explore various operations that we can perform using dictionary so first one is defining an empty dictionary don't mention anything within the curly braces that would be an empty dictionary alright next is integer keys that is dictionary with integer keys for example one apple two ball so the key one and two are just integer right so it's a dictionary with integer keys next is next keys dictionary with mixed keys that is we have key of mixed data type for example name is string up here one is integer right this is mixed key next we have is pairing that is from sequence having each item as a pair dictionary one apple two ball all are taken as a pair element fine next is accessing dictionary so what if i want to access a dictionary so i can directly access using the key fine for example the word one is associated with key 1 and word 2 is associated with key 2. so if i want to access word1 i can directly write my dictionary of 1 and it will give me output as word1 fine let's move ahead now what if i want to find the length of the dictionary then i can directly do it using the len function len of my dictionary is giving me the output as 2 why since it consists of two elements word one and word two fine next is key now what if i want to find the key of my dictionary so i can just use the key function my dictionary dot key it is returning me all the keys within the dictionary fine it is returning me all the key defined within the dictionary next is value well this function is used to return all the values defined within the dictionary for example we have apple and ball as value within this dictionary my dict all right so that's why using value function we got the output as apple and ball fine let's move ahead okay so now that you have learned about dictionary so let's discuss about the last data type that is set sets are the unordered collection of item within the curly braces that is items are defined within the opening and the closing curly braces and you don't have to define the key value in it it is basically an ordered collection of item if you are adding elements in the set then make sure that every element in the set is unique for example you can define a set as my set equal one to three well it's almost similar to as dictionary right but it does not has any key value associated to it it's the only difference between a set and a dictionary all right let's perform some of the function using set and understand it in a better way so the first one is creating set you already created a set all right next is union well union of two sets return the common value from both the set for example my set s1 equal 1 2 and c my set s2 consists of 1 b and c so if i am performing a union on it so it is returning me with 1 2 c and b so basically what it is doing it is returning me the common values of both the set fine next is the intersection well intersection is used to return the common result from both of them that is end of my set s1 and my set s2 so what are the common elements in both of them we have 1 2 c 1 bc so we have 1 and c common in both the set so we got the output as 1 and c fine next is the difference well this difference would omit all the common value from both the set and it will return the only value which is a unique and first set for example we have one two c in set one and one bc in set 2. so if you subtract it so you have one in both the set so it will emit it 2 and b so nothing can be done about it c and c again it will emit it now since only 2 is left in set one so you get the output as two all right fine so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so this was all about the data type in python so now that your base is clear let's have a quiz so what would be the output of the following code test one equal python programming and print test one from two to six in order to know the correct result do post your answer in the comment section below alright so let's move ahead next is the python flow control well these flow controls are the one which control the flow of execution of your program so we have six different types of flow control in python if else nested files for while break and continue let's discuss them one by one starting with if else so what is this if else let's see its syntax if the condition is true then execute statement one else execute statement two it's as simple as that let's see the flow of execution you start it you check the condition if the condition is true then execute block one if the condition is false then go to the else part and execute block two fine yeah this block one it comes under f part all right let's move next let's move ahead next is nested if else let's see the syntax if condition one is true then execute statement one else if condition two is true then execute statement true if none of them is true then execute statement three let's check the flow control of it start check for condition one that is if condition one is true so if condition one is true then the statement executed with the if block is executed that is execute block one if first condition is false then go and check for the second condition that is else if condition now if else if condition is true then your second block would be executed if none of them are true then finally the else block would be executed that is execute block three and yeah remember one thing there is no condition associated with an else block else block would only execute if all the f conditions are false fine all right next is the for let's see the syntax for iterating variable in sequence colon execute statement let's check well it's the example of a program like start we are defining a variable as count equals 0 then execute statement then increment the value of count by 1 and then check the condition if count is less than 10 is 1 less than 10 yeah the condition is true so again repeat it and again execute the statement again increment the value of count by 1 that is count become 2 and again check if 2 is less than 3 and so on continue this till 10 is less than 10 and when this thing arrived that 10 is less than 10 your condition become false and you exit the loop so this is how a for loop work let's understand this in a better way with an example so this is our code all right we have to find a list fruits as apple banana and cherry for x and fruits x and fruit of 0 is apple then print x x is what apple so apple would be printed as the output now again what we'll do we'll again go back and check for x and fruits now x of 1 is banana then print x x is what banana so it would print as banana again it will go back x and fruit of 2 is what cherry print x cherry would be printed now if it goes back there's nothing left in the fruit so nothing would be printed all right so you got the final output as apple banana and cherry fine all right so let's move ahead next is the while the syntax for this is while condition is true then execute set of statement under the while start check for the condition if it is true then execute block one and then again repeat the loop until the condition is true in case the condition is false then just exit the loop let's understand this better with an example this is my code like a equal 1 and variable part i got a equal 1 while a is less than 5 as a equal 1 less than 5 yeah condition is true then what print the value of a all right so we got the output as 1 after getting the output increase the value of a by 2. so a plus equal to 2 that is 1 plus 2 equal 3. now again go back to the loop check for the condition is 3 less than 5 condition is true then again go to the print a part what is a 3 so print a so you will get the output as 3 again increment the value of a to 2 that is a equal 5 now check the condition is 5 less than 5. no i think here we got the condition as false so we got the final output as one and three all right let's move ahead here's another example a equal 1 in the variable part a equal 1 check the condition y a is less than 3 is 1 less than 3 yeah condition is true inside the y part the first condition that we check if a mod 2 equal equal 0 is one mod 2 equal equal 0 no the condition is false so i'll jump to the else part so we'll jump to the else part and print a is odd now since the value of a currently is 1 so 1 is odd fine then what we'll do we'll increment the value of a by one that is one plus one equal two fine now again we'll go back to the while part now i'll check if 2 is less than 3 yeah the condition is true fine now what we'll do we'll jump to the if part and check if two mod 2 equal equal zero yeah the condition is true so this time we'll check if two mod 2 equal equal 0 so yeah the condition is true so what it will do it will print the if part statement that is a is even a in this case was 2 so 2 is even fine so this is our output next again it will go and increment the value of a by 1. so now 2 becomes 3. again it will go back to the y part as 3 less than 3 the condition is false so your final output is 1 is odd and 2 is even fine so this was about the while statement let's move ahead and learn about break so this break statement it is used to break the loop at a certain condition all right let's understand this with the help of this flowchart started check the condition if the condition is true then check the break cut then check the break condition if the break condition is false then only execute block one and repeat the loop if the break condition comes to be true then break the entire loop and then exit the loop all right let's check it with an example up here just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pad to know the right answer now let's continue with the session for example a equal 10 while a is greater than zero check for if a is not equal to 5 ok is not equal to 5 then print a else break it fine let's execute it sorry just branch a minus minus so we got the output as 9 8 7 and 6. fine so the moment loop becomes 5 we got exited out of the loop next we have is the continue statement well the continue statement won't break the loop so it will just skip the statement in case the condition is true let's understand this with the help of this flowchart so start check for condition 1 if it is true then check for continue condition if it is false then execute block and repeat then in case if the condition is true then stop executing that particular block for that particular loop and cut for that particular iteration and again go back and repeat and check the condition all right let me just show you let's just replace this break with continue and let's see what is the result so yeah see got the output as nine eight seven six four three two one but you didn't got five up here right why so as i told you this five was skipped fine so this was all about the flow control so let's proceed and learn about function so what are these function well a function is a block of organized reusable set of instruction that is used to perform some related action but why do you even need a function well what if you have to write a program in which you have to use same set of code again and again for example you wrote a code of 20 lines or 40 lines and those 40 line of code are coming in your main program at 10 different places and you have to use those 40 line of code 10 different times in the program so i don't think that none of you would be interested in writing the same lines of code again and again so in order to resolve this issue they created function so well this function is a block where you write your code which you think you might use it again at some point of time therefore it allows the reusability of the code and thus minimizes the redundancy in python there are basically two types of function the first one is the user-defined and the second is built-in function let's see them one by one so what is a user defined function well any function defined by user is a user defined function right syntax it starts with a keyword def after that an identifier for a function name and then you pass the arguments into it all right followed by semicolon and after that you mention the set of statement inside it all right let's see an example for example if you want to add two arguments so you define a function as add and inside add you pass two parameters as a and b so sum equal a plus b and return sum that's it so it's as simple as let me just define a user defined function for you it's like it start with the keyword def after that i i'll write a function name as add inside that i'll pass two arguments a and b semicolon and this function should return me the sum of a and b all right fine so this is my user defined function next is the built-in function now these built-in functions are a predefined set of functions in python we have abs function which returns the absolute value of a number we have all function which returns true if all items in an iterable objects are true we have any function ascii function bend function bool function and many other built-in functions are available there in python if you want more information about it you can just check out the python official doc all right now that we have defined a function now let's see how we can call a function so calling a function well there are two ways of calling a function you can either call it by passing a value or by passing a reference let's see them one by one so first is pass by value calling a function by passing the value for example a equal 10 diff def that is keyword so we are defining the function as print the value of b is b and again inside the function we are updating the value of b to be hundred and print the new value of b is b and then what we are doing change it and we are passing a now since the value of a was 10 so this function would take the value of b as 10. so print value of b is 10 and new value of b is 100 let me just show you in order to resolve this issue let's define the value as a equal 10 define my function inside that i'll pass an argument as b print the value of b is b concat fine and next we'll update the value of b to be hundred and again print the new value of b is b fine so this is my function now what i'll do i call my function by passing a value calling a function by passing a value to it so i'll write my function and inside that i'll pass the value as a since the value of a was 10 let's see the output see so we got the output as the value of b is 10 and the new value of b is 100 so this was about calling a function by passing a value to it next we have is pass by reference calling a function by passing the reference for example so we have a list as c 10 20 30. so we are defining a function as change them and we are passing an argument d to it inside the function we have print value of d is d d of 0 it's a numeric constant we are defining it as 99 d of 1 has 98 then print the value of d is d then change them now when we are calling a function by passing the reference so what we are doing we are just passing the entire list to it so uh what will get the output will get the output as value of d is 10 20 and 30 and the new value of d is 99 98 and 30. let me just show you with an example c equal 10 comma 20 comma 30 right now let's define my function 2 inside this d is what print the value of d is d all right next we'll define some numeric laterals like like d of 0 is equal to 99 d of 1 equals 98 and then print the new value of d is again d fine this is my function now if i call my function using pass by reference so my function 2 and i pass the value c into it so let's see what we get the output so we got the output as the value of d is 10 20 30 and the new value of d is 99 98 and 30. fine let's move ahead well when a parameter is passed by reference the caller and the cody uses the same variable for the parameter well if the column modifies the parameter variable the effect is visible to the caller's variable but when a parameter is passed by value the caller and callee have two independent variable with the same value if the caller modifies the parameter variable the effect is not visible to the caller well the things that you need to note on this definition are well the variable word here means the caller variable itself that is if i pass a local variable by reference and assign to it it will assign the college variable itself do you know what is the meaning of reference and pathway reference well it is different from the general term reference it is that this reference is temporary and implicit what the callee basically get is a variable that is somehow the same as the original one here on the screen is a very good example of pass by reference and pass by value all right in pass by reference you are filling a cup using the reference of the cup and in pass by value you are actually filling the cup using some values so this was all about how you can define a function and how you can call it in python now let's discuss about the lambda function in python so what is this lambda function well a lambda function is a small anonymous function lambda function can take any number of arguments but can only have one expression note the fact that lambda function cannot have more than one expression so here's the syntax lambda argument colon expression for example we have x equal lambda e colon a plus 10 and print x of 5. so what it is basically doing it's defining a lambda function that adds 10 to the number passed and as an argument and then print the result let me just show you an algebra notebook let's define a lambda function as x equal lambda of a such that a plus 10 and then print x inside that will pass the value of 5. so what do you think the output should be 5 plus 10 it would be 15 all right if you change 5 to 10 the output would be 20 all right let's move ahead so next is function versus lambda function so what we are doing up here we are comparing function with a lambda function so here's a normal function which takes two argument and return the multiplication result of both of them and here is a lambda function for the same it's like r equal lambda x comma y such that x multiplied by y and if you call r 12 comma 3 what it will do it will return the result of 12 x 3 that is 36 i'll just show you this in our jupiter notebook for example i'm defining a function as df let's name my function as multi i'll pass two arguments up here x and y colon now return me the product of x n y that's it it's done right now what if i have to define a lambda function for this so i'll write like z equal lambda of x comma y such that it equals to x multiplied by y fine now if i want to test this i'll write print z off i'll pass two values on it 12 comma 3 so it should return me as 36 right so yeah i got the output as 36 fine let's move ahead next is the power of lambda function well the power of lambda function is better shown when you use them as an anonymous function inside another function for example let's say you have function definition that takes one argument and that argument will be multiplied with an unknown number right for example you have my function as n returns lambda a such that a plus n so you are defining a variable my sum equal my function of 3. for example let's see in our jupyter notebook define my function and will pass an argument as n such that it should return lambda of a such that a multiplied by n all right now you can use this function definition to make another function that always doubles the number you send in for example i can write double me equal my function i want to double it so my function of 2 i need to multiply it with 2 now print what number do i need to multiply so double me for i want the double of 12. so double me 12 output would be 24. so if you want to triple it just change it to 3 your output would be 36 and so on all right so this was all about the lambda function fine next we have is python classes and object so what is the class and object in python well python is an object-oriented programming language and almost everything in python is an object with its properties and method and a class it's like a blueprint for creating objects let's see an example of class we define a class as class space class name colon and inside that you define its objects if you want to call an object let's see how you call it you're defining a variable as obj1 and you are assigning all the object of myclass to it and if you want to print one of the variable of myclass so you can access it using obj1 all right so this was about the classes and object in python so coming to our last topic of file handling in python well file handling is a very important of any web application well you have four different features which you can perform in file handling you can open read write and delete a file using python all right let's see them one by one the first one being open so you can use open function to open a file and it takes two parameters the file name and the mode let's see the syntax syntax is f equal open path of the file so you have the syntax as f equal open path of the file and its mode fine let's see what are the modes so we have four different types of mode read append write and create for reading you specify r it's a default value and it opens the file for reading and the file does not exist it will return you an error next is the append and the mode is a alright what it will do it will open a file for appending and in case the file does not exist it would create a new one next mode is w which is write it opens a file for writing and creates a file if it does not exist fine i'll tell you about the difference of appending and writing later in this section all right next and the final one is create that is x it creates the specified file and it returns an error if the file with the same name exists it creates the specified file and it returns an error if you already have a file with same name fine let me just show you like f equal open path of the file i'll open it in my d drive d slash name of the file test file dot txt and comma what should be my mode it is a reading mode r hit enter so as i told you earlier it would throw you an error if the file does not exist right if you want to create it you have to mention x up here and it will create your file let's go to our d directory and let me just show you the file d so you can see the test file up here right so this is how you can open a file in python or you can even write w up here it won't throw you an error since it creates a file if it does not exist but it won't throw you an error in case the file with same name exist all right next is the read function well suppose this is our file it consists of document hello welcome to demofile.txt this file is for testing purpose good luck let's open our demo file test file hello everyone welcome to intellipaat good luck save it save it as test file dot one fine let's see what a operation we can perform on it now what if i want to read it so how will i do so f equal open demo file dot txt comma mode r r is what reading mode and then print f dot read fine let me just open that file for you f equal open the path of the file it was d colon slash test file one dot txt and in what mode i want to open it in read mode and i want to print all the content which is present in that particular text file so f dot read it first and then print it hit enter so these are the content of my file hello everyone welcome to intellipart and good luck fine now what if i want to read some parts of the file like i want to read the first five characters of the file so what will i do let's see and just copy and paste it i want to read the first five characters so just mention five up here what will it do print first five characters from the text file hit enter so you got the output as hello zero one two three four and five so these are the first five character from the string all right fine now what if you want to read the first line so for that you have a function as read line all right your function has read line which would be used to return one line or the first line again copy it paste it up here read read line just hit enter sorry you got an error okay i wrote wrapper d line okay sorry l is small redline so you got the output as hello everyone this is my first line next what if i need to read first to line of my document so what will i do in that case so in that case what you can do you can use readline twice and it will print first to line of your text like this again do it once more f dot read line hit enter okay in the same error okay so what you got so you got the first two line from your text all right now looping through the file now what if you want to read the file line by line so you can use a for loop in that case so it's like for x in f such that print x if x is 1 then print first line x is two then print second line three so on all right so you will be able to read the file line by line hello everyone welcome to intellipart and good luck next is reading and creating now to write to an existing file you must add a parameter to the open function like you can write a or w a will append the file that it will append or add something at the end of the file and w it will overwrite any other existing content for example let's copy paste it up here instead of r let's mention a it's for bending and f dot write whatever you want to write this is the appending statement executed fine now if you will check the file just check the existing file open it in a redline mode r for x and f print x execute it so yeah so as you can see this is the appending statement got added at the end of the file now what if i use w instead of a so what will it do this will overwrite my statements so here i can write print f dot write print f dot write this will overwrite everything executed done now let's check it again what are the contents of my file so if you check it so only this is left this will overwrite everything fine so this was about how you can write to an existing file all right next we have is creating a new file well you can create it using x a or w using x creates a file and it returns an error if the file exists append it creates a file if the specified file does not exist and finally w it creates the file if the specified file does not exist for example f openmyfile.txtx it will just create a new file and in case you are attempting to create a file with the same name it will throw you an error for example remove this this file already exists right if i'm trying to create it again it will throw me an error all right as file already exist or file exists fine next and last we have is the delete we'll import os module is used to delete a file how you can delete it import the os module os dot remove demo file dot txt that's it but for that what you have to do you have to first close the open file so f dot close inside this mention the name of the file the path of the file d colon slash test file 1 dot txt first close it sorry it's like f dot close close the file now if you want to delete it you need to import os module to it import os and os dot remove inside that name of the file what is the name of the file test file 1 dot txt that's it for the error the system cannot find the specified file so i guess the file is no it's not deleted okay i haven't specified the path of the file i just written the name of it so i'll write d colon slash and the file got deleted so yeah there is no test file one all right fine okay let's get started with numpy so i believe you guys already know like what python is capable of how powerful it is so we can use python for all sort of things right from desktop development web development till data science we can do anything and everything with python in the programming world and next thing is python builds upon its functional modules okay so it has all the all core constructs of programming like there are three types of programming that we have structural object oriented and functional so it can it is capable of doing every everything okay next is when we work with anything in python we have a fancy thing called package in python okay so those packages are available for free in the market it has a lot of built-in functions and built-in things that will help you guys to write many many codes easily without going for the detailed algorithm and all so in that way these packages are really helpful so what will be will we do we will be starting with this numpy for today okay so after that we will see i mean after that we will go for sci-fi so these two are basic packages for data scientists so numpy what it does it is used for mathematical and logical operations on the arrays okay and it provides feature for multi-dimensional arrays also so again when we tell arrays python doesn't have any array it is built on list only so basically when we go through numpy when we go for indexing slicing and all those kind of stuff it will only be the list everything will be based on the lists okay so that's how it goes okay so that's what we will start with so numpy will have a lot of functions which will help you to i mean play around with the arrays of it okay so that's how it works so now what we will do we will just cover the basics of numpy and then we will go for the coding examples and all so that's how we will be planning for the day for that let me open up a new kernel for you guys so that it gets easier for typing out the codes okay okay so let's go ahead with the ppt now so first of all we will see how to create a numpy array okay numpy error means again i will repeat it is just python list it is nothing more than that but it has some added features along with python lists it has some added features so that's why numpy is used due to some extra features that we don't get in normal lists in python just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipaat to know the right answer now let's continue with the session so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so numpy can support 1d 2d both of the kinds of arrays okay and i think you might be using this anaconda version of python so but that will be coming along with pandas and i mean numpy version a pre-installed okay numpy will be pre-installed in the python versions okay i mean anaconda python okay now when you use a package right what we do we import the package okay we import the package with something like we the syntax is it can be any package okay alias can be anything so what is the syntax syntax is import then there will be package name then there will be ask keyword just to assign an alias otherwise you would need to type the entire thing throughout the program and then we will have alias name of np okay so that's what it was okay so now when i say numpy array it can convert anything uh any any python data structure to arrays okay so that's how it works okay so if i show you like this why it is taking time now yeah so see it has converted both these things so the first one is a python list second one is a python tuple right so when we pass that argument that tuple or a list to a numpy array uh function it converts them all to a numpy array okay so that is what this this returns okay and whatever we provided as you see the outputs are starting and ending with square brackets right so that means it is already converted to a list now we can perform various functions in we can perform various functions in numpy yes so once we have numpy error created it can be editable okay because it's a list now it's not anymore a tuple so that's a way it is editable okay and numpy doesn't come by default with python if we want to use it we need to install it so let's say you are not using anaconda and you are using this kind of a python uh user interface then what you need to do you need to install it using command prompt okay pip install sorry i am writing it again and again people install numpy so it will find it and it will install numpy okay i don't have this pip version set so that's why it is not working but it should uh install it okay so that's how it works that's how we can use numpy in the in this kind of functions also okay now we can have 2d arrays in python also like 2d errors in numpy also so how we write it we write it like this so we just need to pass 2d arrays so 2d array means 2 lists right we can pass 2 lists so it will be concatenated to 2d array okay so it will be changing it to 2d array so that is how we write it in numpy now that is how we create arrays in python so that's how we do it so now next will be uh how where it is and i mean where it is advantages rather than using a basic python list or python like that python list or python tuple right so by number you are changing yes so we are changing data type from mutable to non-mutable it's the other one right right next is nd array object okay so in numpy as i have shown you two 2d arrays right it can go up to n and then can have any number so in real world if you ask me we don't use more than 2 max to max 3d arrays but yes it can go up to that okay so like that it works so next is and next is like why why we use numpy arrays so in numpy this nd arrays will have all the items of same type okay so it can't be one of them is end and one of them is string list it has two it all all of them has to be entered okay like that so items can be accessed using zero based index as you know uh python arrays python lists also starts from zero indexing rate so here also it remains the same property it has zero index so if we go for numpy array then if we want to see the first row it will be like this so it will give you the first row and this will give you the second row right similarly for columns if you want to see first sorry if you want to see the first column you need to do this right sorry so you need to do this so you will see the entire values if you need to see the only the first column then you need to do it like this like that it works right so that's how it will be working now for 2d arrays i will be coming okay i am working on 2d sorry i forgot so that's how it works okay so we will be coming to that in a few minutes so 2d arrays i will show you so for others what was the names a and b right 2d arrays i will be showing you not an issue so for arrays if you see 1d array it will give you a 0 that will be 1 a1 will be 2 like that and if you do 1 to 2 then it will be printing only single element because the right hand side index is always left okay right hand side index it is not up to it goes up to that it is not including the right right hand side index so that's why it has two elements now if we do this then it will print all if we do this that also will mean the same and it will print the same it is pretty basic pretty much like the list that we have in python okay now uh numpy arrays are beneficial because it takes up the same size of block in the memory for all the objects that it stores okay this part we will see a comparison in the later later half of the section and then we can understand like where it is beneficial rather than storing it in a classical list uh then numpy era okay now next is if you go into check the individual yes right so it will be begin color n minus one that is how so right hand side will always be excluded like that okay next is numpy array initialization right so how do we initialize numpy errors as we have already seen right how do we do or do that but still this is how you do it okay so initialize means uh what we want to do is we don't want to place any list in uh list in there okay but what we want to do we want to have some by default values okay default arrays we want to take it up okay so let's see how we do it okay first one is we will i mean if you guys are familiar with the terms like masking and all that is for image processing and for data processing we will do that a lot of times we will do that okay so lot of time we will be a lot of time we will be using the zero based or one best indexes okay so for creating a zero based arrays right what we need to come on what we need to do we need to have some some sort of uh like some shape of zero arrays okay so that's how you do it okay that's how you do it in numpy so what you do you write num np dot zeros then you specify the then you specify the dimension of the array okay three by four means it will have uh like three rows and four columns so first one is off so you can think it like this it will be np dot zeros then row comma column okay that's our tuple you need to pass it to okay that's that's this kind of top tuple you need to pass it to the python arrays okay so that's how it works in python i mean in numpy so that's how you print zero arrays in numpy okay next is if you want something uh with the interval right so how you do you write like this np dot array within bracket we pass so it will print you another new array so what we are doing we are sorry in here what we are doing by adding yeah so in this what we are doing we are yeah right it's a range so it's a range actually okay so what we are doing we are passing three variables first one is the starting number second one is the ending number and last one is the the line is the interval that we want to print so from 10 to 25 we are having five we want one uh lists to be five separated right so first one and second one difference will be five like that so that's how we have so we have three numbers right ten fifteen twenty and uh always remember the right hand will be excluded so 25 won't be taken up so till twenty we will go okay till twenty we will print it out okay so that's how this kind of arrays are getting printed out in numpy so using this a range you can have other types of data visualization why it is needed what uh what what we are how we are going to do with data visualization in python so that's what we are going to see okay first comes into picture what is data visualization so data visualization is basically a presenting a data presenting numeric or any kind of data we're using a i mean using charts and graphs and or any other pictorial formats right so uh by that what it does is if you this is this is a proved theory that written uh instead of going for a written or some reading some written thing and between visualizing a picture or seeing a graph the second one that this graph or this image technique helps to remember or grab the context much more easier okay also it gets easier to explain how what we are going to do with this graphs and charts right so that's why we we do use so many graphs and charts in our ppts in our excel files right stewart to make the client understand easily like see this is the data that we drill down and this is what we have found out so this is the trend that you have so that's why you need to tweak in here or tweak in there to change the change your parameters like that so that's why these things this data visualization thing gets really important for being data scientist data analytics or in any any field right in any field this get this is very important so if you are working in iit industry or banking or finance doesn't matter you will always need this visualization technique so python provides a really powerful tool so a few libraries are there so as i already told in python you you would uh generally not be required to write those long codes like with algorithms with displaying pictures and all those things you you are not sub you will write it but it's pretty less so most of our most of the time what it you will do is you will grab already refined and already optimized library that is available in net those are also those are all all the time will be open sourced so those open source libraries you can grab and you can use those two you use those as as it fits your purpose okay so that's what is what and why is data visualization important next is if we go to this visualization this this helps the clients to understand the data much much more clearly also if you if you see a few numbers over the years let's say we are trying we are going to give a summation like a project estimate for a new project that our company wants to onboard right so in that case also we what we would need to do we would need to analyze the data right how the shifts will cover uh what is the id work what is the ams work that we have like the support work or the development work what we have and what we don't have those kind of things those are basically done so by taking data from clients like okay fine i can give you an estimate provide me this this this details or what we can do we can take experience from our previous projects in the in our company that is currently being run we can analyze their data and we can shoot them like okay this is what is the thing okay and we can ask data from clients also so that's how we can do okay so in those cases data visualization comes really handy okay and data visualizes presenting the data that you that you have in a graphical format so that means let's say you are collecting trends for some something over a few years so what you will have 2013 some let's say it is education ratio male 98 female 100 like that this this distributed data you will have so 2013 14 15 till 19 you will have some uh till 18 you will have some xyz kind of data but that won't really make sense right so if you just plot it uh a real sense right how the ratios have changed how what is the trend like more initiative in this or if you have a more drill down let's say do like those those rural and urban area levels then which which level guys are performing better okay so that's what is data visualization all about so that's where uh we use it and that's why we use it so if you if you i will show you some example also real world things where this data visualization comes into picture and how this comes handy that we are going to see in a few minutes okay so that is what is about this and uh next is uh i mean data visualization example see here we are trying to explain some difference of mammoth and cyber tooth cat so if you see those pictorial way if you tell them uh it has long teeth both of them will have long deeds right so the the do it it will get confused but if you just say i mean just plot these data if you just show them with the picture like uh compare the upper table and the below below pictures then later one the picture one is much more clear right so that's where data visualization comes handy okay so that's what the idea that's why we use it and as a data scientist you will almost always always be using this technique to get some insight from the data like that okay okay so now uh the the things that i was telling you like this data visualization why it is important and how different it becomes when we plot the graphs from from saying the data points only let's say in this one and this chart the there are four four data sets right they are just points of x and y okay they are just the 2d points of x and y so this if you see all these four data sets and if you see their basic stats right uh like some average standard deviation and all this kind of average basic stats then you will see that those have almost the similar kind of values right sum is some sum is always like 99 sum for x is 99 for y is 82.51 average for uh x is 9 like that so all the basic stats of this data sets are similar so if you just see those with naked eye like like this then you will not find any difference between these data sets you will basically go ahead and comment okay these four datas it's the same nothing to uh don't need to worry all these are same all the characteristics are same now the next thing i will show you will you will see how how how different the data sets are uh how difference the data sets are you will see that so if you are going to plot this data in this in this the 2d plots right so see here what it happens do we have it in example i believe we don't have it okay fine so if you plot this data in in a in a in a 2d plane right this will look something like this that is in my screen so let me just grab my piece of code for this nscom portrait so that's how it becomes uh but the the data visualization comes handy okay so that's where it comes handy so i will just get it and we'll run this one i have this in my screen so see this is how the data sets differ from uh what differ when you just go ahead and plot this in a graph okay i will show you the code but no need to be worried that that is i mean already given so if you see this is the same kind of data that we got here right so if you see here for the first data set the data is almost evenly spread and it fits a linear equation right almost fits a linear equation it's almost there right for the second one see a accept curve is there for the third data set it is again a straight time okay only one or two points are here and there those are outliers so can be safely excluded so this is almost there but in the fourth line see that type of data it is stacked all the points are stacked in here because if you check this all the y well x values for the last one is set as 8 except one for one value that is 19 right so all the values are stacked in here for x and this is the 19 1 for which x equals 19. so this is how different the data sets are okay this is how much different the data sets are but if you see their correlation coefficients mean standard and everything that is printed over here r is for correlation coefficient so if you see here you see all the values are same i mean there is not much of a difference okay so one one thing need to be remembered that this is this hanascom portrait is a unique data set okay this anna's com just found out these points these sets of data with this 2 4 6 8 10 11 data data points to be having this kind of characteristics this is a pretty unique thing uh after this nscom quarter it was discussed there are many attempts to revisit those and almost everyone who is related to this data science and machine learning or maths or stats things they always have tried to back calculate thing and try to predict different kinds of data set to have the same kind of thing like where the descriptive stats are almost same with four data set obviously with four x and y data sets so four four uh for four of them the descriptive stats are almost equals so that's what i am telling rajiv just let me finish so uh this for these data sets this is the unique data set okay so for in here those four of them are all the four of them have same kind of descriptive stats but it just differs radically when you plot those okay so that is where this comes handy so for data visualization starting purpose this is a very good example and there is no other data set till now uh discovered which has this kind of values with four four different data sets having same kind of descriptive stats but differ in the different this radical way like how this graphs are okay how these graphs are different okay so that's where this thing comes into the that's where this this thing comes into picture okay that's where it comes handy actually okay now if you check the code that i have pasted here so see uh this is how we import matplotlib into our python code so matplotlib why matplotlib coming to it just as i am explaining the code i will explain this and then we will go ahead and discuss this so this matplotlib code right so that's where what we are doing is in this matplotlib code what we are doing we are just uh i mean this is a matplotlib library and this is a object oriented library also okay so that things we will discuss later if you want to do that you can just take this xy points and you can try plotting this points in in the v plot like we showed in the last class right how to plot a line chart so you can try it that way also if you are not having the data set also so then also you can do this okay then also you can do this from this picture itself i believe in this in this file this anascom quadrate picture won't be given i think so because i don't have it if they have updated then fine you can take it from that code part also but i don't have this one okay so i just had my own version so the any way it will work no need to be worried okay and also the data set is already present right so you what you can do you take two arrays x y x one y one x two y two x three y three four arrays you can take off x and y then merge those like for x y plot together x one y one plot together in the line chart and then only you can see this kind of plot this is nothing nothing much okay so that's how you can do no need to be worried on that but that's really easy codes once i explain this you will understand okay so what we are doing we have taken all these x points here then we have calculated y point with this equation and if you see the equation will fit this one to some extent so yeah that will be better so if now if you focus on this i will show you how those are plotted okay so that will be uh that will be helpful for you so see here we have used pld.plot x and y1 if you even if you for now if you do even i mean if you don't give this this parameters it is fine it doesn't it is not required it will give you some kind of plot also so for now keep it to plt dot plot x comma y1 and you can have the color also if you don't give it it's fine it will give you a nice good color so that's how it works okay so that's how these are plotted so others though that i have those are really advanced level things no need to be worried for now i will skip those uh we will we will discuss those later that's fine for now for now just just see we have plotted x and y 2 x and y 1 like that okay so that's how we have done x y 1 x y 2 x y 3 x like x sorry yeah like that x x y 1 x y 2 x y 3 and x 4 and y 4 why that because if you see the x part for all these three data sets are same right so only one array would do and for y we have four different arrays and we have plotted those okay we have plotted those using this plt dot plot line other lines that are there even if you don't give it not an issue it will still run okay you i mean if you have that in the code you can try yeah level the variable means which one like x and y it will take automatically so plt dot plot as if you remember i showed you yesterday the first first one it will take the horizontal axis second one it will take the vertical axis so it will have x and y two okay other things we are coming that will be uh that will be we will be coming in shortly we have this uh in far more detail shortly okay okay so that's what is uh nscom quadrate so next is data visualization libraries we have a lot of libraries available for python to plot these graphs okay plot different kinds of graphs we have matplotlib gg plot c bond plotly and geoplotlib so all these plots comes handy in data visualization but the matplotlib it has a really good interface it has op module models included it has a different kinds of graphs pre predefined in it it can like a as you as you saw right we have a set of function we have access function text function those all those functions are for customizing the graphs they are very high level things so this is just to change your graph and then that can radically change your graph your graphs can be very beautiful if you explore this more and more you will see your graphs are getting really beautiful for presenting it to present again to someone those will be required but for data science related purpose for your solutions when you are exp i mean exp i mean experimenting with the data sets that that is not not really required but again ah when you are presenting it to someone it can come handy but that's that's that's fair enough i mean if even if you don't get it right now it's fair enough uh you can you have time for that okay so that's how it is sorry what is happening okay so next is a matplotlib is there next is c bond c bond is again built on top of matplotlib and that's also a very good uh good plotting uh plotting library so but and generally we use matplotlib the most then comes the c bond plot others we really don't use it for now okay we really don't use it because those are those are having some here here and their limitations and all okay just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pack to know the right answer now let's continue with the session so this is a this can create 2d graphs and plots using python scripts obviously whatever we are seeing it can create multi-dimensional graphs also but those are not for for now those are not required uh when we see machine learning we will see that like the contour contour plots are there what are those and how they look we will see that okay those are kind of multi-dimensional graphs so 2d graphs and plots can be created easily using python script it can produce the output in a various hard copy format that means whatever graph you see here you can save it to a png file jpeg file or whatever so that's that's where this comes really handy okay that's where it really comes handy okay next is this is a next is why to choose matplotlib because it has a first of all it is a oop based api okay the library is almost based on op settings so that means it will have the same kind of structure as classes and objects when you try and refer them at plotly modules so that's why you must have seen we have used matplotlib dot pi plot right so matplotlib is the basic class and pi plot is a function of it so that's why class name dot object name by i mean sorry object name dot function name that's how we use it right that's the op basic so that's how we do it okay yesterday you saw we can integrate this using pandas and as this pandas is based on numpy so numpy is also possible i have shown you examples but this matplotlib was not known to you so you can you can go back and check the examples where i showed you okay next is very wide variety of graphs we will see to see that next like how what all types of graphs we have in matplotlib and how that can be used and what are the usage of those graphs and what we use it like that we have seen simple functions used for visualization so if you go ahead and see here forget about the first example see this basic what we have done we have taken a np dot a range okay we have taken a x variable uh np dot a range and we have the values from 0 to 10 with 0.1 separated okay then we have taken a y value which is 2x plus 5 so that is an x and y linear equation okay and we have plotted the x y points and this this is how it looks like so this is how you plot a line plot in matplotlib okay next what we have done plt dot show to show this plot okay to show this plot to you so that's how easy is uh i mean that's how easily you can visualize a function in matplotlib okay so with this plt dot show function you can see the graph in here and plt dot plot will show you the plt dot plot will plot you this line okay so that's how easy uh it gets when you use matplotlib functions for data visualization okay so that's how it is and and always remember one thing the the behind the scene the main module that that is responsible for uh for this data visualization is called pi plot okay so that's why if i go back to the code you will always see we have imported the module matplotlib dot pi plot okay we always have used it right and we have used alias just to uh just to have a ease of reference right uh so that we don't need to write the entire thing in there so that's how it is okay so that's where this matplotlib is how that's how easy mat.lib is what are exceptions so let us understand that uh firstly let us look at the definition of exceptions with regards to programming in programming an exception is defined as an event which stops or interrupts the intended flow of a program's execution so as a programmer when you write code you have an intended flow of how your code blocks will execute in what particular order and what exactly you need to execute so anything that comes in between anything that occurs out of the blue any exception so to speak any error that happens that is unaccounted for will totally interrupt your flow and that is called an exception and we need to deal with that in programming sense because otherwise we can break our applications right so let's look at this from a technical perspective there are two types of programming languages that exist so the first is a compiler based languages and the second is interpreter based languages right so in compiler based languages what happens is all of the code is firstly compiled and converted into byte code so that the machine can execute it all at once so in this particular case before the execution of the code the code is converted into low level language right the entirety of the code so in this particular case what will happen is you'll basically have your code structure where the code starts there will be a code module one a code block one that will execute which doesn't have any errors or exceptions so it will execute successfully and then if you encounter a code block or a part of the code where there is an exception a code block so it will simply throw a compiler error that there is an exception over there there's a code error over there simply go and fix that but it will not interrupt the code module 3 at least in the compiler sense of way the module 3 will compile successfully and you can even run the code and it has a chance of running successfully so this is called compiler based languages these are like uh for example we can take c c plus plus java these are compiler based languages all of the code is first compiled and then it is executed so uh on contrary to that we have uh interpreter based languages now in interpreter based languages the entirety of the code is not compiled it is just executed line by line right so python is one of those languages obviously python is an interpreter based language so the workflow of interpreter based languages goes something like this so the code starts line by line right the first code module is executed because it does not have any exceptions it is correct so it is executed so the next code module where there is an exception when that is encountered right what that will do in interpreter based languages is that it will stop the execution altogether so the next code module will not execute either right so what happens essentially in this particular case is that even if the code module 3 does not have any exceptions it is completely logically correct right it will still not execute so in interpreter based languages not handling exceptions could lead to the entire application breaking right so we want to execute things that are correct right even if code module 2 is wrong we want to resolve that particular issue and we want to move on to code module 3. so unless we handle these exceptions that is not going to be possible right so uh exception handling is meant to deal with exactly this so let us look at the workflow uh of this particular case if we handle the exceptions so how to handle exceptions in interpreter based languages it is sort of the same for compiler based languages as well except we all know the logic of whether all the code modules will compile or not in compiler based languages in interpreter-based languages we do not need to concern ourselves with that what exactly happens over here is that the code module one will execute successfully as it should when the exception is encountered in code module 3 we can see a little bit of change in the flowchart except for the arrow uh instead of the arrow pointing downwards from code module 3 right over here as we can see the arrow goes to the right and it basically goes into the condition which says that if there is an exception execute this part of the code on the right hand side and then continue as usual to code module 3. so even if there is an error in code module 2 we have created a fail save for that essentially in this if exception clause so whenever there is an error which is encountered we go to the if exception clause and then the if exception clause continues on code module 3 and we are able to execute the entirety of the program as much as possible without actually having to stop the execution at at all right so this is how exception handling happens in a diagrammatic view so now that we understand the workflow of exception handling in python we can look at some examples of exceptions that can actually occur in python in day-to-day programming so we'll look at some simple ones so you understand the concept the first one we're going to look at is called the zero division error now the error name is pretty straightforward it happens when you try to divide a value by zero or you basically try to get the remainder of that particular value by zero so the modulo operator or the division operator so essentially uh if you understand this arithmetically when you try to actually do this uh in in theory what happens is you get infinity when you divide a number by zero right in computational terms you cannot actually compute infinity so to deal with that particular issue what programming languages do is that they throw an exception when you try to run this particular operation right so you can design cases to deal with this particular exception if it happens other than that this is what the error is called it's called the zero division error then we have the name error now in name error what happens is when there is a variable name that you're using which has not been defined previously right and you're directly using it it'll throw a name error for instance if you try to write a statement which is a equals to b plus 3 and you haven't defined the value of b right then it will throw a name error because this b variable has not been defined then next up you have type error now the type error refers to data type mismatch essentially so what happens in this is when you try to basically perform an operation where there is a data type mismatch for instance in this particular example we can see that a equals to hello which is a string value plus 4 which is an integer value we are trying to add an integer to a string without any implicit or explicit conversion right we are not trying to convert this particular integer to a string value and then trying to add it we're trying to add it as a numeric value itself now when programming logic that cannot happen we need to convert this 4 into a string if we want to add it to our hello value right so in this particular case it will throw a type error because there is a data type mismatch between string and an integer so if programming languages have defined a variety of exceptions there must be a way to deal with these exceptions as well so what happens essentially is that every programming language has its own way of dealing with this exceptions right in python there are ways as well so let us understand what is exception handling first exception handling theoretically is defined as the process of adding fail-safe measures into the code to keep the program running in case of an exception right so it's essentially used from the application point of view to stop the application from breaking when an error is encountered right so let us understand the various methodologies that python implements to deal with these particular exceptions so firstly we use the try block right so the try clause is used to define the block of code that you intend to successfully execute if no exceptions occur right so instead of writing code straight forward like writing print x without the try block what you will do is you will simply write the try and then you will indent a print statement after the try right so this print statement is now under the try clause so if an exception happens you can now handle this particular exception instead of the program simply giving you an error and stopping you can now find a way to deal with this particular exception you can try this code if this does not work out you can deal with the exception that happens so next up we have the accept block right so the accept clause is used to define the block of code that you would want to execute if and when an exception is encountered in the try block right so say in this particular case suppose the print statement fails so when it fails the control goes to the accept block and it will print exception right so you can deal with this various ways you can add various categories of exception in front of the accept clause to deal with that particular exception only which we will see in the example that we are going to execute but this is how you would deal with a particular exception when you try a part of code and it does not execute successfully you can straightforward go to the accept block and execute that statement which is present in the accept block then you have the else block now this is an optional block of code that you can use it is used to define the block of code that you would want to execute optionally if no errors occur in the try block so say if the print statement executes successfully the accept statement will obviously not execute because you haven't encountered an exception but the else statement will execute because the try statement did not have any exceptions essentially so it will basically print the value of x and then it will print no errors then finally we have the finally block right so this particular block of code is also optional in exception handling you can use this particular block of code when you want to execute a particular set of instructions regardless of whether an exception is encountered or not so the final block of code will execute whether an exception has been found in the try block or whether the try block has successfully executed it will still execute so in this particular case whether the exception prints or the value of x prints the will always execute will always print so this is this is essentially how you handle exceptions in python so now that we understand how these four uh particular clauses work uh we can now move on to the demonstration part of this particular tutorial so let us see how exception handling works in an hands-on experiment so let us now see some of these exceptions in action so firstly let us try to execute the name error so if we try to do this a equals to b plus 1 right and we execute that so it simply gives us a name error right so the way we can deal with this is by simply going over here and adding a try clause right so when we add a try clause we can put a tab statement over here and add an accept statement and print the message that we want to print in case this particular exception occurs right so exception has occurred we do that and we click on play so we can see that instead of this particular statement executing and giving us a name error we can see the message an exception has occurred right so next up what we can try is something different we can write over here accept name error right so this is the category of exception that we want to deal with specifically instead of dealing with all of the exceptions that is what happened right so if we play this as well we can see the statement exception has occurred right so let us try something else with us we can also add a finally clause over here or an else clause let's let us first try an else clause right so when we add an else clause we can type print no exception has occurred right when we do that and we click on play it still gives us the message exception has occurred because the exception is actually occurring right but instead of that if we simply change the b to 1 right now the statement should successfully execute because there is no exception over here now we click on that and it will simply print no exception has occurred and if we type something like print a over here and click on play again so it will first print the value of a in the try block right and then it will go to else and say no exception has occurred so next up we can try something else let us try the zero division error so in this particular case what we will do is a equals to 100 modulo 0 let's try that and print a right now we can type accept name error so we know that this is not the name error this is the zero division error right but we'll still write that and we'll see which exception is actually caught right so print name error has occurred except zero division error will print zero div has occurred then we play that and we can see that instead of this particular exception printing the zero division exception has printed right so since we did not catch any name errors the zero division error was caught when this particular statement tried to execute right so instead of that if we simply go over here and change this to one right it will simply print the actual output so when we divide 100 by 1 the remainder is 0 right we can add something else over here which is called the finally block and print hello right so in this particular case what will happen is we play this and we get the zero from the try block and the finally from the hello block but that is not all uh say if we change this back to zero right now this means that we get the zero division error once again right so now what will happen is we'll get the statement which is zero div has occurred uh in which in this particular case the error was caught the zero division error and then the finally block was executed regardless of whether the try block executed successfully or an exception block executed right so that is how the finally block works and finally to look at the last error which is the try which is the type error we'll simply type try b equals to hello plus 17 which is a an integer value right we do that uh we type print over here type p we go to accept and we type in the type error which is the error that that we are probably going to catch over here print type error we do that and then we can try to add an else statement over here print the print statement over here will say something like no exception has occurred and finally we get the finale block which says i am going to print regardless right so when we try to execute that we can see uh the exact workflow of how this is working out so the tried statements try to try to execute tries to execute we get this b equals to hello plus 17 this does not execute because there is a type mismatch the data type mismatch string and integer we go to the type error right now since an error was actually encountered an exception was actually encountered the else statement will not execute as well so this statement will not execute because error was encountered right and then finally block the final block that we have over here will execute regardless because it executes regardless anyway so if we simply go back and change this to say 11 which makes this a valid statement now so it will change the output so firstly we will get the 28 which is 11 plus 17 we get the 28 we get the output from the else statement which says no exception has occurred no exception was encountered and then finally we get the final statement anyway so i am going to print regardless right so this essentially explains how exception handling works in python now additionally we have the option of raising exceptions as well right so we have the option of specifically specifying conditions in which we would raise exceptions instead of relying on the predefined exceptions that python already gives us so say if we want to throw a type error or in exception in general so let us type in something like x equals to 14 right so this is a value and now x is equal to 14. now what we can do is simply type in if x is equal to 14 in which case we will write if x equals to equals to 14 and then given the condition of that particular statement and then what we would do is raise an exception this is an exception is the message that we are going to use so when we do that and click on play it throws that particular exception which is this is an exception right so we can even configure python in a way or we can configure our code in a way to throw exceptions on our custom predefined conditions right so the raise statement is used for that we can also do other exceptions with this particular statement now if i simply start a code lock again over here right i can raise another exception say for instance i i type in a variable now i give the variable a string data type so let's call this string data right now what we will do is we will check the type of this particular uh variable now to do that we will simply type in if not type a now we're checking the data type is end which is the data type that we're actually checking whether the a variable is of integer data type or not raise type error and say that integers are allowed when we do that and we click on play we get an exception which says the exact message that we typed in which is a type error and integers are allowed so that was the example of how exception handling works i hope you understand the workflow of it and the exact uh pattern of how these exceptions occur and how you can handle them very easily you can also see how you can create your own exceptions by using the raise keyword so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills what is an ide an ide stands for integrated development environment so it is a software application that contains several tools for helping programmers to write edit and evaluate their code so think of it this way whenever you're writing code you need several applications to work together things like code editors to write code and save files compilers to compile the files to run the files if you are writing tests then you need test runners if you are trying to take a look at the memory consumption of your application you might be using a profiler there are many other tools that you can use for instance checking the memory leaks and all of these things can be done using several tools but they are all interspersed in the coding world so bring them all together what you can do is you can use an application like integrated development environment so integrated development environment or ide is just a term used to describe such an application and these kinds of application are available for a lot of programming languages including python so what are the benefits of using an ide so let's take a look at them so there are several benefits of using an ide or an integrated development environment uh let's take a look at them one by one so firstly it allows for rapid development ideas provide some really great tools for you to write an edit code quite uh in quite a speedy way they allow you to define code snippets so that you can write just a few keystrokes and expand the code and then fill out the important details uh it reduces boilerplate coding they allow you to generate files they also allow you to do syntax completion so if you try typing a long name for a variable or a function or a class they you can just write the first few letters of the entire name and the suggestion will appear on whether or not you want to use it is up to you then comes enforced standards so many development environments allow you to use something called a linter or relentless it takes a look at your code and it takes a look at a standard that has been set by a company or maybe by you and it checks whether the code is following those standards so these standards could be not more than 80 characters on a line uh small method names or large method names methods that are not more than six lines in definition there could be many other standards that you could use many companies use these standards to make sure that the code is clean it's readable and many companies also of uh also enforce standards such as writing documentation without which your compiler might not even compile your code so these standards can be set up depending on what your requirements are if it's just for uh taking a look at clean code or whether it's more than clean coded it's more about tooling and all so these standards can be enforced using an ide then comes easy configuration you can mold an ide especially there are many ids that are really really easy to configure to your needs you can change almost anything about the many ides that you use going from font to the user interface configuration about the compilers and interpreters you can take a look at a lot of things and you can use all of the you can change all of these things depending on your needs they do come with a sensible default but these defaults might not work for you so you can change them at your own at your own pace and then comes project management if you're dealing with multiple projects then dealing with them without an idea could be a little difficult let's say that your project contains several sub projects as well so these kinds of problems can be really difficult to keep track of and ideas can help you with that as well they allow you to export configurations for projects so that you can share that with everyone around your team and they can use the same thing again just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session now another thing that project management that comes in the project management is version control system so things like git github subversion material all of these things they also come under project management and many ideas including pycharm have a really good support for using git and subversion and mercurial and other kind of version control systems let's take a look at some of the most popular ides so here are some of the most popular ideas as you can see it's pycharm it's intellij which is also from the same company of jetbrains then comes eclipse eclipse is more popular for java development but it's not really necessary that it can only be used for java development for instance if you want to use eclipse with python there's an extension called pydev pydev that could be really really helpful if you are proficient with eclipse you know the shortcuts and you want to use eclipse for python development so for that you can use a pi div extension it's a little typical to install but if you've already worked with eclipse before then you already know how to install it and once you do you can use python with eclipse visual studio comes with a built-in support for python so if you want to use and if you want to install some additional templates and other things like that they are also available via the use of plugins then comes comodo ide it's also very popular especially in the python community so you can use that as well then there's rstudio it's not for python but it's used with r so it's very useful in that regard and then as you can see comes phpstorm so php storm is something that many web developers use and since many of these ids are free and many of these are not free and when they are not free then you need to either download a community version which is a version of the ide that comes with limited set of features which are helpful for you when you get started or you can buy the pro version or the premium version many ideas have different terms for these or at the end of the day you can also apply for a student's license which if you are a student they can give it to you either for free or for a review a much reduced cost so you can take a look at that as well then comes introduction to python so let's take a look at uh what pycharm is so pycharm is an ide for python language it has been developed and maintained by jetbrains it's currently under active development new versions are being released every now and then and new patches are being released every now and then as well it is one of the most popular ide especially for python if you're a python developer and you are writing code for python and you're working in large corporations chances are you have already come across pycharm and pycharm is really really good for writing code in such a manner pycharm is it has got some really great features it's got some really good plugins as well that you can use for your python code you can enforce standards you can do a lot of things let's have a demo and we'll see how to use pycharm so if you want to use python the first thing you have to do is you have to download pycharm now it's very easy go to google and first thing you have to do is you have to download python so you can go to python.org click on downloads and download the latest version uh i mine is 64-bit windows so it already gives me that version to download and if you don't find the version you want to download you can scroll around and get the version that you want to downloading the latest stable version would be the best way to go after you have installed python you can install pycharm by downloading it so you can just search for pycharm click on the download link that is given to you in your google search when the link opens it will show you multiple options to download one of them is the professional version and the other one is the community version so the professional version is quite useful especially for those who need the premium features that come with pycharm and for those of you who don't really need the premium features just want to try it out just want to make sure that you get the basics of pycharm correctly then you can download it using the community version the community version is for extremely easy to install and really easy to use and it's free and the professional version although it's not free gives you every 30 days try so you can use that it's available for both windows mac and linux i'm using windows i have downloaded community edition and i have installed it installing it is really easy so let me just open it for you i've already installed it so i'm not going to go with the installation again but if you want to install it just open the installer and it will work just fine after you install it it gives you the option of opening the pycharm ide right there as you open it it gives you the opportunity to create a project if you already have a project and bear in mind that this has to be a pycharm project a pyjama project basically is a folder with a dot ide a dot idea uh folder in it that contains all the configuration that python will use so you don't need to worry about that you don't have to use these you don't have to edit those files yourself but if you don't already have a python project then i would suggest you create one using create new project which is what i will do now this is just the basic setting if you want to take a look at some advanced settings you can take a look at here now uh you can take a look at the environment that you can use if you are working with scientific computation you can take a look at conda pip n is for creating a virtual environment using virtual and or paper i like using pip and it allows you to isolate your dependencies so if you're trying to use some library such as django or flask but you already have it installed and now for this project you want to use some new version you can use a virtual environment in which all the libraries you install will stay in that library and that for that project only no other project would be able to access those libraries so you can use that and you can take a look at the interpreter i have python 3.7 i have python 3.7 and you can also take a look at anaconda's distribution of python if you have and you want to use that so with that selected if you have an existing interpreter and you don't want to use the current interpreter you can just click here and browse for it and then use it but as of now i'll be using the base interpreter that pycharm has already detected for me you need to change the name of the project i'll click i'll call it telepath demo i have used pip 10 because i find it really easy to use but it's your choice if you want to use virtual and you can use that if you want to use conda as your development environment you can use that as well it's totally up to you click on create and the first time you use it it will take a little bit of a time because it's setting up a virtual environment for you and virtual environment takes some time so as i had already created a demos like this it will create a virtual environment for me and if it already finds a virtual environment it will just use that virtual environment as you can see it's creating the virtual environment so let's just wait for a few seconds and when it gets done we'll get started with the next steps now if it's just a new installation that it could take a little bit of time for you uh and if you have already installed it and if you have already used it then it might not take that much of a time so don't worry about it it will just take a few moments and when it does uh it will open everything up and it will start creating something called indexes so let me just tell you what indexes are they are basically things that your pycharm ide will create so that it's easy for it to scan the entire project and find files that as you can see it's launching the skeleton generator everything can be seen here it's discovering the module reloading the generated skeleton skeleton is basically the project structure that it has generated for us now it's telling us that it's indexing which is basically it's taking a look at scanned projects and it's taking a look at all the files that we have so that when we try and scan something inside or search something for it much more speed and accuracy so now that that is done i we can use python or whatever we want to use so as you can see this is the folder that i have i can click on the this arrow to expand it as of now since i used pip i only have pip file if i open it this is what it looks like and it's giving me an option to install a plugin that will help me create uh to get syntax highlighting and better support for pip files i don't need to do that right now i'll show you how to install packages in a moment uh but first let me just create a file and show you how to run it to create a file uh right click on the project that you want to create a file in go to new and i want to create a python file and since it's giving me that option i'll just create on python uh this has to be a python file not a python unit test file not a python stuff so i'll just create a python file i'll name it main and i'll press enter after giving it the name if i don't give it the name then i won't be able to create any files i'll create one for me now as you can see this is fine but the code editor looks fine it's working fine if i something if as you can see it's working fine the problem that i have as of now is that the text is really really small so let me show you how to customize python to your own test so go to settings by clicking on file once this appears you can take a look at a lot of things uh it opens with the editor setting but you can take a look at a lot of things if you want to search for some setting like let's say font click here and it will show you all the things that you care about i need to change the editor font so i have that here now it is by default using the jetbrains mono uh font but i want to use fire code and i want to increase the font size let's say to 18 let's say to 16 and for line spacing i can take a look at this as well and as you can see i get this nice preview right underneath it so after doing that i can also enable ligatures so enabling legacies basically means that it will allow the code to dictate how it wants certain symbols to look so if i disable the leakages as you can see that not equal to will look like an exclamation point and and then an equal to symbol but if i enable the negative then it looks something like this so the font will now dictate how the for how certain combinations of symbols should look like i click on apply and then i click on ok and now as you can see the font has been changed now you can play around with it a bit but it works fine now let me just write some python code and then execute it so you can see that it works so the first thing i'll do and as you can see i have syntax highlighting so if i type in name and i get the suggestion that i want and i want it to be equal to main if you don't understand this don't worry this is just some simple python code and i'll even uh show you some resources through which you can learn python if you want to get started with python and you can already see how we can use pycharm so i'll just create a function named main and here i'll just move the code for those of you who are wondering i'm using the shift key and then moving things around so if i use shift and then press down key pycharm will automatically insert the pass keyword but i don't want that so i'll just do it here so now what will happen is uh my script will get executed it will take a look at the file name and uh it will take a look at an internal variable called name which automatically gets set so if i use this file to execute every other file then i'll get main and then it'll print execute this function and it will print hello so to do that there are many things i can do i can just click here and run it or i can go to run click on run which is here i click here i want to run main and it will run it for me and as you can see it's printed hello and the process exited with the code of zero which means everything went successful now let me show you what else you can do let's say that this is not just one file and you use multiple files so i create another file in which i'll create a configuration class let's say configuration helper okay this will be the name of a python file i click insert i'll type in some code configuration helper firstly i'll define a constructor and in a moment i'll tell you how i'm doing this so just type in as you can see let me just show you again i type two underscores it shows me all the things that i can do i press the tab key it automatically does everything for me and now i'll just print construct okay so now if i want to go back to this file if i let's say i have multiple files and i've closed this file first thing you can do is press the shift key twice so shift one shift two and you need to do it really fast and then as you can see recently open files are showing here but if i want to open up this type main it will show me the main method as well as well as the main file so let me let's say that i want to go to the method wherever it's declared it's showing me the file name right beside the function name as well i press enter and it automatically takes me to that function now that that is done let me just import it so i need from configuration helper input configuration helper i i'm using the control and space key together so hold down control and press space to get automatic completion uh and after doing that all i have to do is create let's say an object out of it this gets done so now what will happen is if i run this i can run it from here and you can take a look at some of the shortcuts as well which is ctrl shift f10 if you want to run it so the constructor gets run first and hello gets put second now as you can see i have made a spelling mistake which is deliberate because i want to show you some of the other features of pycharm but first if you if i want to go to that file again hold down control key and then hover over that uh class name i click on that class and i am immediately taken to this file in which i have declared this now as you can see i have miss typed the name so as you can see it's already giving me an option to do something about it but another thing i can do and i want to show you this is select the class name right click there's something called refactor so if you can see it's here and then it also gives a shortcut key which shift action click on rename and i want to rename uh it wherever i can and in the project files you can click on all places as well so that it can take a look at all the places available to python and rename anything that's name like this to configuration helper so as you can see configuration helper now i can click on preview and it'll show me all the changes that it will make so these are the files and with the changes will be made click on do refactor now it has changed it here but it has also found out that i'm uh i'm referencing configuration helper in the main.pi file and it has changed it here here and here as well so these are the kind of facilities that you don't get when you're trying to code it out in a simple notepad or simple text editors and these are the really powerful benefits that you get when you're using an ide now that is done uh let me just show you another thing which is the debugging capabilities so i'll just create another function print with hello and all i'll have to do here is i have to print and i'll do some files in code here i'll format the string and inside the format all i have to do is pass in name so what it will do it will take a look at the string print hello comma and then takes a look at a variable i can remove this as well and takes a look at the variable name the name and prints that for us replaces this empty brackets into name this is what's known as python string interpolation also so uh you can do that as well and now just to make it a little more complicated i'll just create another function def get a big name and as you can see as soon as i type this character which is an opening parenthesis python python automatically types self closes the parenthesis and types a colon for me and all i have to do is return default config save this go here and now if i run this it works fine we get constructor we get hello and instead of doing this now what i will do is i will print with hello but i will use the config get default name and now if i run this you will see that the execution will be changed a little we get constructor hello and this now if i want to debug this debugging basically means stepping through the code line by line to see what has changed now this is really easy to do especially in python i want to debug from this line right so i can instead of running it click on debug main or i can click on debug as well and choose main as you can see here if we do that and that happens starts debugging and we get here as you can see right now no variables have been declared in memory so we get nothing and we get options to step over some code step into the code step into to see your code if it's a library code and you don't want to step into it then you use this function which i will do in a moment and you get to step out so i want to step into my code and see what happens when this configuration helper gets instantiated click here it opens the file it takes gives us the name of the value of the self variable if i open it it's giving me the memory location as well and as you can see nothing's been initialized as of now i step in it prints constructor if you want to take a look at this you can take a look at consoles simultaneously and you can see constructor has been printed now you go ahead print hello world take a look at the console it gets done only the config variable has been created as you can see there are no variables associated with the config object and i then step into the function it returns default config after that it steps into the function that we have declared with the print with hello function prints everything and then exits because that was the last line everything has been printed and we have come to the end of our code so that's how you can debug things now that that is done let me show you something interesting let's say that you want to uh after going to that click on settings there are many settings available for you you can install some plugins to make changes to the way things work if you are if you are using vim as the code editor then you can install the ideavim plugin you can change the look at the material themes as well there are a lot of things that you can install and it these things either upgrade the functionality of some existing feature or they introduce new features as well for version control you can take a look at many other version control systems like git if you want to add a github repository you can do here as well mercurial subversion and finally for our project we can take a look at project interpreter right now we have not installed any package so we don't have to do anything if you want to install a package click on the add button and as you can see it's getting the list of available packages let's say that i want to install flask this is what the current version is if i want to install flask i can just click on install flask if i want to specify a version here are the list of available versions so you can see it's very graphical very useful i'm not going to install flask right now because i'm not going to be using it in this demo but you can do it if you want so with that in mind this is what it looks like this is what a break point is so when you are debugging i put a breakpoint here so that i can just debug my code and the execution will stop here and from that point on i can just step into the code so it's very easy to do if you want to do it so there are a lot of features that i can go into this could be a really really long demo but to help you get started i hope this was quite enough and has wetted your appetite and if the python code was not something that you understood don't worry i'll guide you through the resources that can help you out but the intention of this demo was to help you get started with pycharm to help you understand how you can use the basic features how you can customize it to your liking you can change the theme you can do a lot of things that you want to do how you can navigate around the code how you can debug the code there are a lot of things that you can do so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so with this uh let's come to a quick introduction to what cborn is seaborn is a data visualization tool in python so as a data visualization library cbond is considered to be one of these amazing tools uh you know that's actually built on top of another library called as matplotlib so cbon is an extension of matplotlib in a way where it adds more uh aesthetics in a where uh in a way where it adds more ease of use to the already existing matplotlib which again i'm sure if you're at this video you might have heard of my plot lab and there's a good chance you know that it is again a beautiful looking uh library where you can work with a lot of things and you really don't have to put a lot of effort so it's nice to work with it's easy and if you love data and visualizations you're going to thoroughly enjoy this tutorial guys well this is how the pipeline works right so uh this is a very simplified pipeline so take a look at it you will find data from multiple sources be it excel sheets be it data from your clients place b data uh you know on the cloud b data anywhere else right so data from multiple sources is brought into your company or you know into your business by a data engineer or so and then the data scientist sits there and data scientist performs all of these analytics a data scientist adds uh algorithms to make sense of this data and then pushes it on to the data analyst team and you as a data visualization person is a key part of the data analyst team because in a way with visualization what you're trying to do is you're trying to make more sense of data aesthetically and in fact and you have the ability to drive detailed analytics in a way where uh you will not have to put in much effort but you can see hidden insights and treasures that lie within the data uh you know which you might not see uh as soon as you look through it through the naked eye as well so in with respect to that seaborn is an amazing tool to use so why would uh you know one go on to choose seaborn right so michael vascom is the creator of seabourn and he says and affirms to a lot of python users and a lot of data analysts across the globe that cbon tries to make hard things very easy to use and see in the world of programming this is a very bold statement to say and uh it's not just michael who says this uh it's a lot of people it's hundreds of thousands of developers across the globe who actively contribute to cbon because it's an open source library and at the end of the day it's a common consensus that this is an amazing tool to use and as soon as we uh you know move to the hands-on section at the end of this presentation you will understand why uh you know i'm just saying it's this easy and this fun to use as well but then at this moment of time you really have to understand that it's a very powerful visualization tool and do not be fooled for a second thinking that it is easy so you know it's not powerful absolutely not that is the huge advantage when you're working with c bond so now to understand why you have to use c bond you have to compare it with matplotlib only then you will understand what c bond brings to the picture right so you cannot have a total head-to-head comparison with respect to matplotlib because c bar is actually built on top of matplotlib matplotlib serves as the foundational library on which c bond is uh you know built upon and eventually it's it's it's an extension of matplotlib if i have to put it that way but then there are certain differences and at this point of time you have to know this uh if you're looking towards seaborne as well so the first most important thing is that cbon has a high level interface through which you can work and write code in while matplotlib you really have to think about working with a low level interface see the level of interface what we talk about is how easily you can uh work with the syntax and how easy is it for you to teach or in fact you know convey to the programming uh you know convey to the interpreter on what needs to be done how if it's easy if it's readable if it's very similar to common english language it's a high level interface if you really have to dig into the details put in a lot of effort understanding the syntax put in a considerable amount of time knowing what the syntax does and eventually doing it well matplotlib does that and if you're beginning to learn c-bond this might be a very a big turn-off or a disadvantage but then do not get me wrong here matplotlib and both seabond are amazing tools to use but just that it's respect to its level of being uh user-friendly i would say seaborn wins out here in fact even in our hands-on let's compare what uh you know seabourn and matt plot labor there so make sure to stay tuned to that just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b rays c try d with comment your answer in the comment section below subscribe to intel pad to know the right answer now let's continue with the session and then think about uh you know the theming think about the beautification think about the aesthetics think about the control you have over your graphs and visualizations see matplotlib and c-bond both of these are data visualization tools it's going to take in certain numbers it's going to crunch these numbers and it's going to give you a beautiful looking graph it's going to give you an entire sheet full of graphs or it's going to give you a lot of plots hence the name matplotlib you know so having the ability to theme it having the ability to customize it and having the ability to do this easily this is where c-bond wins matplotlib of course can do it to an extent but then it takes a lot of work and uh you know it's not just a lot of work to just have a basic graph or a plot but then it takes a lot of work to make those plots look aesthetic as well right so in today's world when you're in a business meeting when you have to pitch uh the productivity when you have to pitch the analytics aspect of things to a person who is not into programming who doesn't like to see numbers right so let's say you're in a meeting rather than showing them an excel sheet you would rather present them with beautiful looking graphs to tell them this is where we are this is where we should go and all of that right think about it for a second and this is where cbon wins in my opinion and then when you think about it right a very important thing if you've used python and if you've used pandas if you've used all of these other libraries that are dependent especially to provide data for these data visualizations tool are tools you will understand how important it is that these tools can understand data from a variety of sources right for example think about data frames you might have used data frames in the past but then if you've tried to use it with the matplotlib functions there's a good chance you cannot use it at all but then even if you do it's very complex to work with especially uh you know huge data sets and data frames as well so in that aspect again cbon has the capability to handle all your data frames very well and you know cope up with all of that as well so in terms of developer productivity so in terms of developer productivity and in terms of the basic ability to support another library hand in hand cbond wins in my opinion now after you have understood what cbon is uh you know how does it compare with matplotlib and more uh you will have a question saying okay i'm on this video and i want to understand how to learn seaborn well guys i'll not let you uh wait any further because you really have to know how to learn c bond in a structured way well let me tell you this it is very similar to learning any of the other libraries in python or in fact any other library of any programming language as well firstly you have to take a practical approach guys so you cannot sit and read theory and say you know what i'm going to implement all of these later after i finish the theory um that really will not work because i'll tell you why see the first thing you'll have to do to become an expert in any of these libraries which might get complex along the way is to have a strong foundation and you can build your strong foundation by learning in context like you're learning a concept you're implementing it you're learning it implementing it and on so to begin all of these procedures right so you step one will be to install all of the dependencies install c bar and to use cbon you have to install other libraries as well i'm going to walk you through that in a second but then the step one is this you have to install all of these and only then you can work with them side by side right so it's pretty pretty common and you know that by now step number two is to understand the basics and the paradigms of c bond c you have to know what makes seabourn what it is rather than uh you know what makes c-bond stand apart from let's say matplotlib or any other beautiful visualization tool out there because if you honed in on c-bond you need to you need to put your time you need to put your effort into understanding how it works thoroughly after you understand how it works then uh step number three is concentrating on a data set take up a data set let it be a basic one you really don't you really do not have to start with a very complex data set and you know overwhelmed and you know feeling like cbon may be a lot for you and of course that that will not be the case and you will see why because i have a data set for you guys and we will be working on that but learning in context by making use of a data set will concrete your learning in terms of practical application along with theoretical learning as well and of course there's always the last step in fact in my opinion a very very important step that a lot of people tend to skip is to go around communities talk to a lot of people who have used c-bond uh you know make contact leave them a message ask them about their journey into c-bond see what projects that they are doing see if you have an idea where you know you have a lot of data and you want to convert it into visualizations right so you can put your ideas into fruition by making use of this you can implement your projects you can have your ideas customized and in fact you can outsource yourself to other people where you can implement their ideas as well right think about it in an experience standpoint think about it in a monetary standpoint again it's a win-win with seabourn now you will have a question saying all right i am all set how do i start with this well let me tell you this guys to start with c bond right you have certain dependencies it's a data visualization tool in a way where you have to provide it with data right so to provide data to it python has amazing tools right be it numerical computation or any scientific computation which requires a lot of algorithms and whatnot your numpy of scipy and then to handle data in a structured way you have the pandas library a beautiful library to work with which makes python uh you know the beautiful language that is in my opinion and of course since seaborn is built on top of matplotlib matplotlib itself becomes a dependency for seaborn as well so to get started with this it is vital that you understand the basics of all of these libraries guys at this point of time do not worry in case if you do not have the basics of this down yet uh you will see that it is pretty simple to work with it and of course while working on c bond itself right you can work on the data aspect of things and eventually start visualizing it uh you know side by side too but then as of now understand that these are the dependencies and you will have to install all of them as well so the next question you'll have is how do i install c bond well it's pretty simple guys uh you know you'll either use the pip installer the package manager to install cbon it's a very simple command pip install cbon or in case if you're using the anaconda interface uh again using the contour command is very similar instead of pip you just type in conda install cbon and it will install everything that's required to run visualization as well right so that that really doesn't take much effort and i would suggest uh you know you guys pause this video right now uh install cbon in your machines it's very simple and i'm going to show you another way where you really can work with an online uh you know python notebook a python workbook where you really do not have to install anything too i'm going to show you that and make sure you stick around for just a couple of minutes here but then before that right you have to understand that you uh have to import all of the dependencies that you've just installed just installing it is like okay it's on your machine but then to make python use all of these you have to import them into your program you have to import them into your runtime right so that's what we have done on the screen right now we've imported cbon matplotlib pandas numpy scipy and of course any other libraries that you wish to use in your program or let's say any other libraries that your program itself demands that you use as well right so this is a very important step that you import it and then you begin working with it but to work with cbon you have certain prerequisites guys the first thing is that it is always an added advantage if you understand a bit of computer programming the basic structure of how a computer programming language works and the basic structure of even python will help you a lot because c bond matplotlib pandas numpy scipy right all of these are libraries for python so if you understand python then you can use this as a stepping stone to become a better python developer or use this to become a data analyst and whatnot but to go there you really need to have the basics of python down because even though the syntax of python is extremely easy as you'll see in a couple of minutes it is vital and more than vital think about it it's an added advantage right if you already know it you will have a quick head start to eventually go on and work with it but then yeah you will require a certain basic idea of how matplotlib works as well because plotting a graph is pretty simple but then you do have to know the syntax on what you're plotting what type you're plotting how you can work with the theming and why the plot you know shows itself as it does as well right so working of basic computer language understanding python and matplotlib can be a good amount of prerequisites but do not worry in case if you do not have uh you know either one of these or all of these stick with me till the demo you will understand how easy a data visualization tool uh like c-bond is to use now before we jump right in uh you need to understand the features of c-bond right so i've been telling you that c-bond has been built on top of matplotlib in case if you had a question saying hey can i replace c bond completely with matplotlib or or can i uh you know replace matplotlib completely with c bar and not have anything to do with the other well it's dependent you can just use matplotlib and you can still work with it but to use seaborn you really have to know matplotlib because since it is built on top of it well if you take away the foundation it really doesn't work right similar principle here now uh coming to the features of seaborn it has a lot of inbuilt themes to work with beautiful looking visualizations beautiful looking 2d and 3d graphics there you can do a lot of multi-variable data analytics as well right if it's univariate it means you're working on one variable bivariate is uh you'll be working on two variables and tracking them actively and driving analytics based on that and of course you can visualize all of the linear regression models without having to put a lot of effort as well guys plotting time series data statistical analytics and all of the other types of plots is very very easy uh in the case of cbon and then you have to talk about numpy's and panda right the last point you're already very familiar with now right so it works really well with all the data handling stuff that python offers for us and the other libraries too so after all of these in case if you have not had an introduction to python you will have this question saying you know what even r is a beautiful language to use for data analytics and data visualization and r has a beautiful data visualization library called as gg plot 2 in case if you have used that right so you'll have a question saying why do i have to pick python why is python amazing for data extraction visualization one is that it's very easy to use you really do not have to put in much effort the syntax is very easily understandable even if you're a beginner or let's say if you're a person moving from another domain you might be an mba person you know a person in business who loves doing this who has a requirement to do this you might be a marketing person you might be a person who's coming from another programming domain as well right so switching to python is very easy after you switch to python data extraction and visualization will become very easy as well guys and then point number two is very simple it says that it has a lot of libraries that you can do a lot of things with right see for numerical computation as i mentioned you have pandas you have numpy for data visualization you have cbon matplotlib and uh you know it has hundreds of libraries so i literally can go on for hours and hours talking about the libraries of python what it does and how you can use it and uh you know what we can actually have a video on that as well guys so if you have any video requests right head to the comment section and let us know on what topics you want videos about so this way we can customize it and we can provide you the best content possible anyway coming back one important thing about python is that you will have to write a small amount of code to have a huge result this is the biggest advantage for whenever you make use of python for data extraction and data visualization right so whatever code you write really won't be lengthy but whatever results you drive out of that code or whatever the outcome of that code is right that will be huge so that is why python has become one of the popular languages in fact one of the most popular languages for data science data analytics and data engineering as well guys and one last point i have to talk about is python is a beautiful community it's an open source language most of the libraries in fact 99.9 of the libraries are open source so there's a huge community there's hundreds of thousands of developers across the globe interact with them talk to them find out about their journey find out about their tips on how to get started as well right of course we strive to give you the best content possible and with the community you can share all of these and tell others about it too right so it's all about seeing each and every one of us grow together guys and in fact we have an intellipath community as well so just go to google after this video type in intellipath community and you will see that we have experts across the globe and people asking a lot of questions and uh people answering these questions and helping each other out it's a beautiful place to be i spend a lot of time in the intellipath community so make sure you check that out as well enough to the most important aspect of this video right let's take a quick hands-on session uh on how to use cbon and if you're wondering what i'm using here it's actually google's collaboratory so google collaboratory is like a jupiter notebook python jupyter notebook but that google that's completely hosted on the google cloud platform guys so uh you know when you think about it you really do not have to install python you really do not have to install a 100 dependencies to work even with the most complex programs uh you know even the most complex projects that i work on there's a 90 chance that most of it i can work with jupiter notebook you can take your code wherever you want let's say you're working uh you know from your home on your pc perfect you want to take it over to your phone and do something over there you want to monkey around with your phone and you know write write a little bit of code like you choose of course you can do that that's the biggest advantage right and there's an unspoken advantage here you're using the thorough power of the world's most powerful uh cloud platform right the google cloud platform is extremely powerful they have a lot of manpower behind the technology and it just makes things easier guys i'll just show you how so coming to uh the usage of seaborne right so i told you the first step is to install it the advantage of google collaboratory is that it already comes installed and all you have to really do is import them so let's begin all i have to do is click this play button and uh what it does is it imports all of the packages for us we're importing cbar we're importing pandas and we're importing myplotlib at this point of time secondly uh as i told you it's always vital to take a data set approach right take a basic data set and work with it now we'll be considering a data set uh which is the uh now we'll be considering the iris data set and i just uploaded the data file uh for that so this way as soon as i click play here the data set gets completely loaded sns.load underscore data set is probably the most used command for me especially uh you know with respect to c bond so this one command will load your entire data set now to talk a little bit about the iris data set right so it is actually a data set which consists of 150 samples of flowers three species of flowers to be very precise one is the sentosa and we have the virginica and we have messy color as well so what we're trying to do is we're trying to compare a lot of things such as the sepal length sepal width petal length petal width and a lot of other things too so what does this data set looks like uh typing iris dot head will reveal just this guys ids is the name of my data set dot head is basically used to print uh it out so as you can see i have 150 rows of data and five columns out here right so you can see the type of petals here there those are there's virginia and of course once you go on to print everything you're gonna see uh the entire thing as well but then sometimes okay this is a very simple data set looking at it will make a lot of uh a lot of sense and it'll be very easy but then what happens is that if you have a complex data set right you really cannot print thousands of uh rows and hundreds of columns so there's a very simple command to use that iris.describe iris again being the name of the data set iris.describe will give you an overall uh high level presentation of what your data is uh you know you will get a lot of mathematical insight from this what is the maximum value you will get the deviations out of it what is the standard deviation you get the mean value you get count count as in how many values for each of these uh columns you have and so much more right so iris.describe or refine dataset.describe is a beautiful command to use in all of python guys now the fun part starts uh when we go on to start visualizing some things right so uh let's let's have a visualization it's called as a swarm plot uh it's pretty common but then it's very easy to use all it takes is literally one line of code to do to create a very good looking uh uh plot guys so basically uh sns dot swarm plot x equal to species y equal to petal length and we're picking up the data from the ivs data set right so x equal to species we're trying to say on the x axis plot the species for us on the y-axis use the petal length to describe on the graph right as soon as i hit this you can see this very beautiful looking swamp plot it's a basic plot but at the end of the day you will get an idea right so with each of these species how what is the petal uh length that's been plotted and what is the flower that we are trying to match the petal length with right as soon as you start marking the x-axis and looking at the corresponding y-axis you will understand how many units of data are present there in fact how many categories of flowers are present here three categories of flowers in each category of flower what is the average petal length right you can see the average petal length of versicolor species lies somewhere between three and five and of virginica it has a longer petal length uh it goes somewhere about 4.5 all the way till seven right so it's a beautiful way that you can look at it and if i scroll up and if i show you this uh it's really hard to sort of drive this insight right and it took one line of command for us to say hey this is the average petal length uh uh you know you can you can find a lot more with this guy so this is a very simple example a tone down example so that even you guys as beginners can you know pause the video type this set of code work with me so pause as and when you require and make sure that you know you can get this as well so we will make sure to put the data set let's see it's the common iris data set you can just google it and you can download it from the first link that's available as well now whenever you think about plotting it right it always adds value if you can see a lot of graphs and drive a lot of analytics out of it right so whenever i teach data visualization to people they're always excited to see a lot of colorful things happen on the screen and pair plots is one of these ways uh where you know you can uh use a lot of graphs to map a very complex data set and dial it down in a very simple way right just look at this guys uh my command my programming line is very simple sn is dot pair plot pair plot is a type of plotting that we use in c bond iris data set what's the hue we're mapping on species what's the size of the entities it's 2.5 and very simply you can see on your screen right so i have 12 beautiful looking visualizations and you can see the color uh that it's been mapped right so all the blues that you see on the screen is setosa all the orange you see is versicolor another type of flower all the other green adults that you see is virginica right so you can see for petal width versus sepal length petal length was a separate sepal width versus sepal length and sepal length was a zeppelin itself right so each of these graphs have a common x-axis and a common y-axis but then the analytics that you can drive on a hole right as pairing especially when you're performing bivariate analysis where you're using two variables to drive any sort of analytics uh pair plots are amazing to use guys so as you can look on the screen you can do a lot of things with a lot less code right so whatever i said about 5-10 minutes back makes a lot of sense now i hope now all of that is good but what's the basic difference between matplotlib and c-bond the most basic difference is this guys i'm going to show it to you right of course the first step is always to import all of these code uh you know we're going to have to import all the libraries if we have to use it we had already imported it before in the first line and it's still gonna stay in the same run time but then just to keep it a little separate in case if you guys are writing a program from scratch again i just put it out here and secondly we have to create some data right so let's create some random data and uh you know try to see if we can use this random data to create a matplotlib plot for us uh creating a plot basically in matplotlib so we have six lines that's been created out of random data here for us and do not worry about the data as of now right just look at the quality of the graph now let me start using a c bar so uh you know with c bond the syntax as you can see is pretty similar to matplotlib but at the end of the day a direct comparison even in the most simple looking visualization you can check out that uh with respect to c bar it looks a lot more aesthetical than uh you know a very shabby looking uh presentation of course i am a huge fan of matplotlib do not get me wrong but at the end of the day when it comes to making use of aesthetics why not go that extra step to make it look beautiful right you can make matte plot lip look as beautiful as cbon but it's going to take a lot of effort and a lot of time so why put in all of that when you can just use c bond which is meant for that right i hope you guys uh you know got my point here and uh you know you might be wondering saying hey okay so you know what are the other good things that we can do with c-bond guys we so guys we can talk over 10-12 hours to understand in depth about all of the data in depth about all the types of data visualization theming customization and whatnot but my point here is to not overwhelm you guys so as simple as possible let me give you a head start in case uh if you know what histograms is uh you know again all we're trying to do is uh create a random multivariate data for us uh using the pandas data frame and we're just trying to plot uh it one over the other as well right so uh how many lines of code does this guys honestly this is four lines of code and you have a very complex looking graph and here of course we're trying random data out but at the end of the day if this is driving your business analytics you really do not have to put in a lot of effort to get uh you know meaningful insights that's my uh that's my approach here guys so apart from all of these now when you think about it there's so many other things you can do right so there's something called as kernel density estimation or what we call as kde as well so you can have smooth estimations uh based on that now now with uh you can see a direct comparison in between a histogram and a smooth comparison right a smooth estimation or a kernel density or kde what we call as uh is used to perform a lot of statistical analytics as you can see uh you know it can be standard deviation it can be deviations or any statistical concept uh usually takes uh smooth estimations as its output figure as well so when you think about it a histogram stands out very much so if you have a requirement for histograms yes it's available if you want to make use of a beautiful looking smooth curvy if you want to make use of a smooth curvy looking graph where this curve in fact adds a lot of meaning and it's not just aesthetics then yes you can use that as well now you'll have a question saying okay so instagrams are good i can make use of kernel density estimations in a way where you know i can smoothen things up can i do both the answer is yes and no it does not take in 10 lines of code all 12 lines of code it just takes in two lines of code guys with two lines of code as you can see you will understand how kernel density estimation works when it's mapped over a histogram as well right so it's a pretty simple thing pretty beautiful to look at and trust me in an actual production environment right this can have so much meaning and you will understand once you're serious about seabourn right so i'm sure you'll be looking into more depth about it you'll be looking to become a serious data analyst or a python developer or a data visualization professional as well so when you when you think about it that way once you start monkeying around once you start understanding the in-depth concepts and the offerings that seaborne offers right on the beginner level on the intermediate level and even on the expert level you will thoroughly appreciate uh the beautiful data visualization tool that it is guys so let's say if you want any two-dimensional plotting as well again all it takes is one line of code you're going to be using kde plot kde plot is going to give you a basic two-dimensional representation of what your random data looks like and it's random here because we have considered random data right so uh here you can see the data is equal to period data we have a random multivariate data analytics going on out here but then if the data is not random then this graph will make a lot of sense for you guys but then just for the representation's sake uh you know i have tried to keep it as simple as possible guys and then you have something called a joint distribution or joint plots as well with respect to joint plot you can actually have multiple distributions on the same screen right so this is let's say a modified version of what a kde plot looks like but then that's dialing it down to a lot simple extent guys you can uh you know you can have multiple plots that's basically how it got its name joint distribution and with this kind of a data you can try to look at things which weren't visible to the naked eye previously as well it's just not this right think about it totally how many lines of code have we put down out here most of it uh is you know importing the data set in fact we seeing the data set describing the data set and that's about it as soon as you're done with that as soon as your data is clean your data is ready to use a data visualization guy steps into the picture and does his or her magic as well guys so as you can see a small amount of code a very big impact right so at uh at any point in time you can pause this particular video follow along and we'll make sure that you know we'll share this particular collaboratory file as well so this can be handled as a python jupyter notebook file that you can use uh import it onto your local python environment and work with it as well guys so i hope this cbon tutorial was very effective for you guys to get started with cbon and and i hope you got to learn a lot from it as well rest apis are quite useful and python is quite easy to use when we're trying to build rest apis so in this session we'll take a look at how to combine your knowledge of python and web applications and how to deliver the data that you want to deliver via a web service or a rest api and in this session we'll take a look at what rest apis are what are apis how do you use rest apis and then we'll bring a quick demo in which we'll be using the flask web servers to build a web api using python so without further ado let's start but before we begin if you have any questions then please do ask in the question section uh and for those of you who are joining via youtube there's a link in the chat box that you can click to join this as a webinar and then you can ask me questions in real time so that i can answer them so let's take a look at the agenda for this session so in this session we'll take a look at what our data types then we'll take okay so so we'll take a look at apis first we'll take a look at what are apis let's take a look at what apis are so an api stands for an application programming interface so in case you've ever wondered how two applications interact with each other or how two applications can connect to each other and then can pass messages then apis are the way that we do it so in case you've ever logged into a website and they give you the option to log in via your google account or facebook account you might be wondering how they do that do they get the access to the facebook's database servers and use those credentials to then log into the user facebook's databases and then authenticate you that's not really a secure way to do it but a more secure way to do it is via apis so that's how that's why we use apis to expose certain endpoints or certain procedures that other programs or applications can use to talk to us to describe to our application what data they want what applications or what processes they want to perform this api transaction or api communication also allows for a lot of other kinds of applications like cloud computing applications in which you are basically offloading a lot of your computations to cloud computing and this is also something that is done via an api so apis are quite prevalent but a particular kind of api is called a rest api so what are rest apis well when you take a look at an api uh you could be many kinds of apis but if you're looking at a web api then it's most probably a rest api so rest api is basically a standard it's an architectural style it's how you define your urls so that the person who's trying to get something from your api can describe the best way that he or she can the data that they want and then our apis respond to those requests so these requests work on url parameters and methods so to give you a quick introduction if you've ever worked with http which is the protocol that the internet uses there are several methods that you can use a method is basically just the intention of your request so for instance if you wish to get some data if you wish to get data from a web api then you use the get request or the get method as is shown in the image below you use the post request to submit some data to the web api so that you can save it the get request with a id or a unique identifier gets you a particular record of that so for instance if i have a web api that is serving up user information then i can just tell it to get me all the users or save a user to my database or if i give it a particular id then my api will check in my database to see if that id belongs to a particular user if it does then i will send back that user otherwise i'll send an empty response similarly if you want to update the information that the person has given you can use a put or patch request now if put request is basically a request in which you tell it to update the entire rule so all the columns are rewritten and the patch request you just update a particular database nowadays these are used in conjunction so both of them are used with each other but there could be other reasons as well and then finally if you want to delete a particular user or a particular record from a database using our rest apis then you can basically send a delete request to a user url by providing a particular id now one thing you will notice is that i have written slash users so the url is not going to be like that it's going to be the localhost url you can type http colon forward slash and your entire web address to the api and then slash and then from there the api's url will be like the one that you're seen so for instance api dot my website dot com slash api slash and then where i then i send the request to the users url this will get me all the users now apis can be really really more complex and apis are built around the idea of resources so resources are basically uh things in our databases so it could be users blog posts comments anything like that and instead of us then you using the user's url to use the blog post url so instead of going api.mywebsite.com users i'll go api.mywebsite.com and then blogs or comments and then i can use the same request pattern that i'm using here by providing an id get a particular id so on and so forth so that's how that works now let's take a look at rest apis in python so python is quite easy to use when it comes to building rest apis in python you can use many of the available frameworks or libraries or any other kind of software package that you can to build a rest api now python is quite versatile so you have a lot of options when it comes to building a web api in python you have django as a framework now it's a full blown framework it's not a micro framework like flask and web to buy mainly because in django you get a lot of functionalities out of the box you don't need to configure a lot of things you get you get a web server you get database interactions you get validations you get template rendering there's a lot of things that you get out of the box for free or on the other hand frameworks like flask and reptify they provide the basic functionalities that they think is required for a web api and the other tasks such as interacting with the database caching the data other things you can build on your own or if you want you can probably use a plugin that has been built to integrate with the framework so there are a lot of things that you can mix and match when it comes to flask so when it when it comes to using micro frameworks over full-blown frameworks it really comes down to your choice you could use a full-blown framework if you choose to the problem there is that then you lose a lot of flexibility you would have to if you want to use your own caching mechanism you need to figure out a way to integrate it with the framework on the other hand if you use micro frameworks like class you get to choose your own ways of doing things you can do you get to decide how you want to cache data you you get to decide how you want to validate your data and how you want to pass the request and responses so you can do it that way as well depends on the application depends on the team size depends on a lot of factors when building a rest api now let's take a look at a demo so before we take a look at the demo you should have an application called postman it looks like this you need to have this installed on your system because we'll be firstly taking a look at how to uh how to send request and get response back so this is a client that allows us to send http response requests and analyze the response that you get back now i have already created the code for api and will walk through it and mainly what i've done is i have created a folder called user api inside it i have installed flask and that's the only thing i've done and i'll show you how i did that so i go into the user api folder now i am using something called pip env to do that now ppnp is quite useful in case you want to know what pip env is and how you use it uh we have other sessions on that as well but uh to give you basic understanding a pip env or a pip environment it is basically something that allows us to create a virtual environment for our application so any software package that i installed for this application will be confined to this application on other folders other applications i won't be able to use the same uh same frameworks and the same libraries so in case tomorrow i decide to build another web api but not using the flask current version of last but an older version of last lecture flask 0.8 i won't have to uninstall the current version and then reinstall version 0.8 for that particular application i can just use a pip environment and do that so after doing that i can just install using pic env install flask now i already have it installed so i think it's going to not work or it's going to say the requirement is already satisfied but in case you are going to install it on your system then you can as you can see the installation succeeded quite fast because it's already installed but just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answer in the comment section below subscribe to intellipart to know the right answer now let's continue with the session in case you're doing on your system then you will get a much longer description of the steps that have happened now that's the only thing that i need you to install flask other than that we are going to be using in pure python so you go to the folder and you create an api dot p1 and then you create a two other folders a user model and a user service so let's wait for it to open so our goal with this api is to build an api in which a user can access users in our database so if someone send the request to our web api then they can access our users in the databases and they can store and they can do a lot of other things as well so i'll just reconfigure my ide now it works so to give you a brief understanding of what i'm doing i have firstly imported flask request ng75 from our application i'll explain how why we're using that in a moment and we have imported from user service we have imported the user service module so when we go to this folder we have imported user service from here now what's going on here is that i have created a flask application and i have instantiated my service and i'll explain why we have separated these things out and this is the piece of code that you need to write if you want request from other origins so when you're building a rest api then this is something that you need to add this is something that we use to uh allow request from other origins this is to allow us to get away from an error called course error or cross origin request error basically what we're doing here is we're trying any other website that tries to access uh data from our website it's going to be fine because we allow them to do that so with that now we go to the routes so these are the urls that we had already discussed if i want to get all the users i want to respond to my web address slash users so it will go here and it will get all the users using the user service and then jsonified now we'll take a look at what these things are doing we go to the user service and in the service all we're doing is we are taking the model and then we are getting data from the model the reason why i am just forwarding the request here is because in services you can do a lot of things so if i had a caching service then i could probably cache the data that i get from the user and then use that there as well but i don't need to do that so in the model all i'm doing is this let me just open up the model for you here's the model i'm importing sqlite3 and then i'm creating a model inside it all i'm doing is connecting to a database name tulu.db which exists already here because i've already run it then i create you create user table so what this function is doing is that it's taking a look at whether or not to do user is a user table exists or not if it does not exist then it creates it and if it exists then the query doesn't get executed so we take a look at this we take a look at we create an id which is a unique field and primary key take a look at the email and password all of these are not null and then finally after doing that i just create a row factory if you work with escalator you'll understand why we do this but basically we want data to be given to us in the form of rules and finally when the user model is deleted i want to commit the changes that i made to the database and i want to close the connection so that there's no memory leak then forget all users i use the select id comma email comma password query from user table i execute the query and then i return the result in form of a dictionary if this code looks a bit uh difficult for you to understand that means that you need to understand this dictionary and list comprehension and if you want to learn all of these things then stick around with me till the end of the session and i'll show you a resource for you to learn these things so all you have to do here is after converting it to a dictionary we return it back and then when we return it our user service will return the data that we have fetched and converted into a dictionary and that data it then gets returned in the form of json so json is basically uh something that's called javascript object notation it's a format in which we exchange data from one service to another service earlier we used to use xml but xml was not very easy to use and very difficult to pass took a lot of computation a lot of the size of the request would response would get really large because xml requires a lot of closing tags and opening tags so with that we come to the other route that we have described but before that let me just show you how to check whether or not it's working i've already created the requests for you so i open the request and by the way if you want to create a request just click on new request after that put in the address i have not started my web server which i will do now just type python space and my file name is api.py press enter and this starts so it's showing me that it's starting on localhost colon 8001 which is the web address and if i open it here as you can see we have opened slash users on our you base url if i send a get request here as you can see we get the username and password that's already stored in our database now let's take a look at what else we have we have a way of getting a particular user in the database we'll take a look at that in a moment and we also have a way to save user on our database we do the same thing we go to our service and the service is basically delegating the task to a model and in the model we're just creating the user in the user model i go and create user i get the data from the parameters i get email i get password and then i just save it using the insert command and then you just return back the last row id which is basically the last thing that you inserted and you get it by user id so let me just show you how this is working firstly let's try and add a user so suppose you are trying to create a form that submits user data to go to body and let's say instead of i create james at the right example dot com and password is one abcd at the rate one kbc at the red one two three now i send the form data with the request using a post request and it sends me back the data that i got so this is the one that i have and now i want to get a particular user id i can get the data associated with the first user id which is john the date example.com and i can get the second one as well and i've gotten that as well now uh another thing we can do is we can update the users so to update a user all you have to do is again use as i've already told you we can use the put and the patch requests so for the put and the patch request we update user by id we take the user id from our url which flask does for us so the benefit of using a framework is that it does a lot of request parsing and things for you so you don't have to go look at the entire url and then find out what are the parameters that are passed to me flask will do it for you it passes in the user id and all we do is we call the service dot update method we go to the service and again update is doing the same thing it's delegating to the user model and we go to the user model and we take a look at update user by id by the way for getting user by id we're doing the same thing just checking if user id is there then we connect to the database we fetch the result and then we send it back as a json and finally we get the update user function in which we basically use the update query we set the username we set the email we set the password we execute the query and then we get the updated user using the last updated id or the current id that was passed to us id will never get updated so we just update email and password and using the id that we have and then if we take a look at whether or not it's working go to update user and go to body as you can see i've written the ids one and the method is put so instead of chain let's say johnny at the date example.com and password is this now if i send this request i've updated the id it's now johnny and if i now try to get the users let's try and get all the users first and we get johnny and james so jane has been updated and if i get by an id i think i've updated it to be the first id and as you can see the changes have been persisted to our database and finally if you want to delete a user basically send a delete request to one of the users now deleting is a special case mainly because if i open the api.py file as you can see i use the delete method it's the same thing that i've done before delete user by id i send the request to services in my user service i use the delete method and inside it i just pass it to the model and inside the model all i'm doing is i'm deleting it but the thing is i'm taking a look at how many rows were affected by the last query so if it was affected and one row was effective then the status is 200 now let's understand http status codes 200 basically means in http protocol 200 means that everything went okay and as expected 404 means that the thing that you were trying to access was not found on the server so we send the status as well as the affected rows back to the user the service returns the same thing back to the api and the api converts it into json and then send it back to us so i go to the web api and in the delete users part if i send in an id that does not exist i get the response of status code four zero four and zero rows were affected but if i send in an id that does exist i get row count of 1 and status of 200. but if i do it again then again since row of id 1 was deleted then we don't get that now this is how you use it in to check whether or not it's working or not now the main benefit of creating a rest api is that you can now create web applications you can create android applications you can create any kind of application that can access this api so i've created a really small function here here all i've done is i've gotten data back from the api and then displayed in the table it's a very simple use case if you want to take a look at the code let me just show you this is what it looks like now again if you don't know html don't know css just stick with me till the end of the slide and i'll show you basically what i'm doing is i'm creating a table adding this header here and then basically getting data from the users and then converting the data into html elements and then adding it to our html web page this is what it looks like let me try and add another data and then this will be fetched dynamically so if i add another user and instead of james i type in john save it now you get the id to b3 name email and password so if i refresh this as you can see i get both the usernames and passwords that are available in our database so that way you can build a rest api quite easily now again this was a very rudimentary example mainly because rest apis are quite deep topic and they take a lot of time to cover but this should give you a basic understanding how how you can use flask and how you can do it now another question that you might be wondering about is why are we separating things into other files like user model and user services we could have just created it in the same folder and then called the queries and all but when you're trying to build a good application main thing that you need to come consider is separating things into smaller pieces and then separating those responsibilities into other classes functions modules etc so for instance the reason why we are using another layer of service instead of just using the model is because if in future let's say that you get a assignment that says that this api is working but we want to convert it into json but not in json but we want to convert it into xml and we want to cache it as well so caching it you can just go to the user service add your caching code here and it will work just fine and for sending it back to the user sxml instead of jsonify you can use another function so instead of you having to then dive deep into the uh code and then figure out which line or which file of uh the particular project do i need to change you already know how to do it and it's easy to understand as well we can just take a look at the application and understand the flow of request and response and finally we are just running this application in debug debug allows us to take a look at errors if we run into any and we also take a look at port so the port is 8001 you can change it here this is exactly why i'm getting my api running on the 8001 port if i change it there it will be changed here as well so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects we'll give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills just a quick info guys test your knowledge of python by answering this question which of the following is not a keyword in python language a val b raise c try d with comment your answer in the comment section below subscribe to intel pack to know the right answer now let's continue with the session so what will we be doing in this session is that we'll be taking a look at the global data for the google 19 that's available it's an open source data so you can use it whenever you want and however you want to and we'll be building a model that can tell us the number of confirmed cases and fatalities that are expected to occur the next day and that will be done by analyzing the trend of the data that we have right now so with that in mind let's take a look at what we have next so let's take a look at the data that we'll be using now the data as i've already told you is open source so you can use it whenever you want to but basically we'll be using the global covalent banking data this data contains information about countries it contains information about regions it contains information about the population and it gives you a column named target target basically tells us that the data we have is of either the confirmed cases or the number of fatalities so as you can see in the screenshot that i have right below me we have cases for afghanistan and we have certain columns that are having the values of n a n n a n stands for not in number or not available so the problem is that the problem is that when you have a data set there are many times when you don't get to get the data that's completely accurate they're going to be some missing values they're going to be some values that are out of order and not in the correct format and there could be a lot of other things so that would be the problem so if you want to get this data set there you can get it from kaggle and that will explain to you how there are competitions going on on kobe 19 this data is available on kaggle right now we can take a look at the kobe 19 competition and you'll get the data you'll get the problem statements and everything but just the data is enough for you to get started we'll see the learning path for python so for a beginner you must starts with oops concept input output operations in python in error handling looping statements and libraries of python so you need to first master these fields you need to work on these fields in order to master the basics of python then you have to decide which field you want to master either data science machine learning artificial intelligence game development or web development so accordingly you can choose the framework that you have to learn such as for django django is used for web development for game development we use pi game of python then pi test is used for testing then pandas matplotlib for data science tensorflow for machine learning and artificial intelligence so there are hundreds of packages that are individually used for these fields so you need to master the use of these packages and libraries by implementing it so you should select a use case or a basic project of your choice so that you can use these frameworks for creating for working on basic projects to clear the concepts and finally you should move on to working on real time projects that will help you to gain hands-on experience and that will help you to provide experience in working on projects how an organization how an organization implements a project using python so this will help you to become an expert or a professional in python and master the field related to it so this is the learning part for becoming an expert in python if you are a beginner now i will tell you some of the useful resources that we provide to master python so these resources are blog and tutorials youtube videos of intellipaat that you must follow to learn the basics of python and along with it you can learn various frameworks such as pandas numpy scikit-learn django along with their implementation in real time we also have a large community where you can post your question and clear your doubts and queries we also provide a comprehensive training on python so let me take you to the course page so this is our python certification training course so there are instructor led training and self-paced training so instructor-led training consists of 42 hours of comprehensive training 50 hours of project work and exercises then it has a flexible schedule and 24 7 lifetime technical support and access so if you will be having any doubt or queries it will be cleared by our experts at any point of time so it has 24 7 lifetime support and access after the completion of the course you will get a certificate and you will be assisted for the job also we have 24 hours of self-paced training videos that you can enroll for and in this instructor-led training you will be guided by an industry expert on the subject so let us check the course content so the trainer will be starting with the basics of python and then oops concepts in python database connection numpy for mathematical computing that is again a framework of python then skype matplotlib for data visualization pandas for data analysis exception handling multi-threading packages and functions then finally web scrapping with python so this is the course curriculum now you can also check out other courses so you can go to the course section so there are master programs on various technologies on big data data science business intelligence sales force cloud computing mobile development digital marketing and so on so intellipath also provides uh free courses so you can go to intellipath academy and check out our free courses that we provide and these are just the demo courses and you can watch now you can go to the last section of this website and you can go to the blogs that we provide the interview questions the tutorials that you can go through so these are the blogs we regularly update and post our blogs on various technologies so there are interview questions there are interview questions according to various technologies so if you want to learn python then there are top python interview questions then going to tutorials you can go to so there are tutorials for various technologies that you can go through and for programming so here is python tutorial that you can go through for learning the basics of programming so now that we know how popular python is let's head on to our interview questions right so this is our first question what are keywords in python so you can consider these keywords to be special reserved words which exist for a specific purpose now you cannot use a keyword name as a variable name or an identifier so these are some of the keywords which exist in python such as true false not continue and so on and in total there are 33 keywords in python 3.7 now you also need to keep in mind that these keywords are case sensitive that is if you look at the keyword true over here then you see that t needs to be capital so our next question is what are literals in python and then we have to explain about the different types of literals so literals are the constants used in python or in other words this is the data which is stored in a variable and there are four types of literals in python so we have string literals numeric literals boolean literals and special literals so let's look at string literals so you can create string literals by just enclosing the text within quotes so here we have created two string literals john and james so we see that john is enclosed double quotes and james is enclosed within single quote so this is how you can create string literals next up we have numeric literals so numeric literals comprise of all of your digits now if your numeric literal doesn't contain any decimal then it is of the integer type and if your integer is too long then it would be of the long type and if your literal consists of a decimal point then it would be a float and finally we have a complex number which consists of a real part and an imaginary part going ahead we have boolean literals so these boolean literals comprise of just true and false values they are generally used when we are dealing with some condition whose output is either true or false now we'll head on to special literal so python consists of this special literal called as none and it is used to specify a field that is not created here in this example i have assigned none to the variable while do so this variable would basically be empty so this is our third question what is our dictionary in python and we also have to create a dictionary where the key is fruit name and there are four fruit names as values so a dictionary is an unordered collection of elements and these elements in a dictionary are stored as key value pairs for example here we have a dictionary with the name my dictionary and we have three key value pairs so here our first key is one and the value for this key is john second key is two and the value for this key is bob and then we have the final key which is three and the value for this is alice right now let's run to jupiter notebook and create our own dictionary where the key is fruit name and the values would be four fruit names so i'll name the dictionary as my dictionary and we can create a dictionary with the help of these curly braces over here so i'll given the key name which would be fruit name and after this i'd have to given values of four fruit names so let's say my first fruit is apple and then the second fruit is mango third fruit would be orange and the fourth fruit would be guava now all i have to do is hit on run and then let me print this out so i'll just type in my dictionary over here right so we have created a dictionary with the name my dictionary where the key is fruit name and the values are apple mango orange and guava and if you want to extract the individual key and individual values this is how we can do it now i'll type in the name of the dictionary which is my dictionary i'll put in dot and then i'll just type in keys i'll click on run and we see that the key for this dictionary is fruit name similarly if i want all of the values i just have to type in values over here now let me click on run so for this dictionary the values are apple mango orange and guava so our next question what are classes and objects in python so simply put you can consider a class to be a blueprint and objects to be real-world entities which are defined and created from classes for example over here you can see the actual blueprint of a house now this blueprint can be used for the rapid creation of unlimited number of copies so these copies of the blueprint are nothing but your objects and here we have created three houses or in other words three objects from the original blueprint which is our class so i'm repeating it so our class is nothing but a blueprint and from this blueprint we'll be creating a set of objects which are our real-world entities so over here this house number one house number two and house number three are real-world entities which are nothing but objects created from this class next would have to create a simple class with the name human which would give out the name and age of the person so let's do this right so to create a class i'd have to use the keyword class and then i will given the name of the class which would be human now inside this i will create two variables so the first variable would be name and initially i'll just assign none to it and my second variable would be h again i'll assign none to it so we have created our variables now we'd have to get the value of name and the value of age from the user so for this i'd have to create some definitions or methods and to create a definition i'll use def after this i will given the name of the method which would be get name and inside this i will pass in self right so now over here i'll just use the print function and type in enter your name and after this i will get the name and the self dot name so basically self.name basically means that whatever value the user enters it would be stored in this name variable of the object right and i'll just type in input over here so this input function is used so that we can get a value from the keyboard right so this is how we can get the name of the person now similarly let's go ahead and get the age of the person so i'll type in def and i'll name this method to be get age again i'll pass in self inside this right this time i'll use print and i'd have to enter the h so enter your h and then i'll store this in self dot age equals input again right so we have created two get methods where we'll be getting the name and the age of the user now after this we'd have to print out the name in the age so it'll be def and i'll create the method to be put name again this will be self and i'll just print out the user's name so your name is self dot name and then similarly i'll create another method which would be put each and i'll pass in self inside this so for this it would be print of your hs let me again put in double quotes over here right so your h s it would be self dot h so we have created our class where we have two variables name and h and i've created four methods and out of those from those two methods i'll be getting the name and age of the person and the rest of the two methods would help me to print the name and age of the person right i'll click on run so we have created this class now once we create our class which is basically our blueprint we'd have to create the objects from this class so let's say i create an object and name that object to be person 1 now this would be our first instance and i just have to call in human so i'm creating a person instance of the human class now from this person object i will invoke the get name and get age methods so person one dot get name let me click on run i'd have to enter the name of the person let's say the name of the person as sam right so now it's time to get the age of the person so i'll type in person one dot get h i'll click on run and let's say the age of the person is 28 so now i have successfully feeded in the name of the person and the age of the person now it's time to print out both of those so it'll be person one dot put h and person one dot put name so person one dot put name right so your age is 28 and your name is sam right so we have successfully created our class which would print out the name of the person in the age of the person right so next question what do you understand by the init method in python and after that we have to give an example of it so you can just consider the init method to be sort of constructed in python so it is a special method in a python class which is used to initialize the variables so now that we've understood what init method is and what it is used for let's go ahead and work with this edit method so now here what i'm going to do is create a student class with the init method in it so let me do that class student and over here i'll just create the init method and these are the parameters of this init method self so and after this it will take in the name of the person and after name it will take in the age of the person and after this it will take in the branch of the person right now what i have to do is just store these values inside the original variables so that'll be self dot name equals name and then our next variable is h so self dot age equals h and then we have the final variable which is branch so it would be self dot branch equals branch so we have created our init method now after this wait so we actually have to put in d e f over here because this is actually a method right so we have created our init method which is basically a constructor and going ahead we'll just create another method which would help us to print all of these values def print student and l taken self and all i do over here is print in all of these values so print off name would be self dot name after this we have h so let me change this to be age over here and this would be self.h after this we'll have to print in the branch so let me just put in branch over here and this would be self dot branch right so we have created the student class which has the constructor i'll click on run now let me create an object of the student class i'll name the object to be student 1 and let me go ahead and create an instance of this now since we have this constructor over here so i can go ahead and initialize this student object here itself so i'll given the name of the student so let's say the name of the student is bob of this the age of the student is 12 and then which branch is studying so let's see this guy is studying engineering let me just put in engineering over here run now student 1 dot i will call in the print student method over here right so we have successfully created this instance student1 right so what do you understand by inheritance in python and then we'd have to give an example of it so inheritance refers to the property of one class acquiring the properties of another class for example let's say you have inherited your features or properties from your parents so if you see all this family tree over here you can understand that traits such as hair color and poor eyesight are passed from one generation to the next generation so over here this is generation one generation two and grandparents so your parents are inheriting their traits or their features from their grandparents and you are inheriting your traits from your parents now let's go ahead to jupiter notebook and work with an example of inheritance so here what we are doing is we have a base class with the name fruit and this base class is being inherited by another class citrus now this is our base class fruit which has a constructor and this constructor just prints out i am a fruit now after this what we are doing is we are creating another class with the name citrus and this class inherits from the fruit class right so if a class has to inherit another class in python we'll just give the name of the base class as a parenthesis inside our new class now again inside the citrus class we have created another constructor and inside the constructor of the citrus class i am using the super method so with the help of super method i can invoke the variables and functions from my super class right so over here i want the init method from my super class so i'll just use the super method and i'm invoking the init method from this fruit class now apart from this edit method from the fruit class i would also print something else so over here i am also printing i'm citrus over here right and i'll create an instance of this class citrus and i'll store it as lemon now the result is i'm a fruit i'm citrus so this value i'm a fruit is coming from the super class and this value i'm citrus is coming from our new class or the child class so this is how we can do single level inheritance in python so next so what is numpy and how can you create a basic 1d and 2d numpy array well numpy is the most widely used python library for linear algebra and it is used for performing mathematical and logical operations on arrays and to import the numpy library in python you just have to use the command import numpy so again let's head to jupyter notebook and create a 1d numpy array and a 2d numpy array so i'll start off by typing import numpy as np after this i'll create my 1d numpy array so a equals np dot array now i will given a list of values so this is my 1d array e and then let me just print it out so this is my 1d array which comprises of the values 1 2 and 3. now i'll go ahead and create a 2d array with the name b so again the syntax would be the same np dot array so it'll basically comprise of a list of lists so the first list would comprise of one two and three and the second list would comprise of four five and six let me print this out right so this is our 2d array which comprises of one two three four five and six so this time we'd have to initialize a phi cross phi numpy array comprising of all the zeros so there's a five cross five numpy that is there need to be five rows five columns and all of the values need to be zero and to initialize an array with all zeros we can just use np.0s method from the numpy library let me just type in import numpy as np and inside a i'll just state nb dot zeros and i'd have to given the dimensions of this array so the dimensions of this array are phi cross five let me just print out a so we have successfully created our phi cross phi numpy array where all of the values are just zeros now let's say we have two numpy arrays like this so this is our first numpy array this is our second numpy first numpy array comprise of one two and three second number i comprise of four five and six now i'd have to add the individual elements so four plus one needs to become five five plus two needs to become seven and six plus three needs to become nine again our first step would be very simple i'd have to load the numpy library import numpy as np i will go ahead and create my first numpy array a equals and b dot array and the values are 1 2 and 3. similarly i create my second numpy array which is b i'll change this variable to be equal to b and the values are 4 5 and six now to add the individual elements i'd have to use the np dot sum method now inside this i'd have to give in my first parameter so my first parameter would be the numpy arrays which i'd have to add so i want to add a and b and i will set the axis to be equal to zero so when i set the axis value to be equal to zero this would individually add the elements so this will do four plus one five plus two and six plus three right and this is what we have 4 plus 1 is 5 5 plus 2 is 7 and 6 plus 3 is 9. now let me actually change the axis value to be 1 and let's see what do we get right so when i change the axis value to be 1 then the addition happens across the row so when you do 3 plus 2 plus 1 you get 6 and when you do 6 plus 4 plus 5 you get 15. so now we'll have to get the n largest values from a numpy array so this is our numpy array over here and this comprise of of three four five six seven elements twelve forty three two hundred fifty four five and sixty eight and i'd have to get the first two largest values which over here are hundred and sixty eight now let's go to jupiter notebook and let's see how can we do this right so again we'll start by importing the numpy array import numpy as np and i'll create this array x is equal to np dot array and i'll given all of these values now to get the indices of values which are arranged in ascending order we can use the np dot arg sort function now what i'll do is i'll actually insert a cell below and i'll go ahead i'll do control x i'll do control v so we have successfully created our numpy array let me just print in x over here so this is our numpy rate now what i'll do is i'll just copy this np dot r sort of x and i will print it over here and let's see what do we get so what we get over here are index values so 0 1 2 right 0 1 2 this is our lowest value and then we have 5 so element at index number 5 0 1 2 3 4 5 right 2 5 and then we have 0 which is 12 and then we have 43 right so we basically have the indices of the values arranged in ascending order so 2 5 12 43 54 68 100 so this is how it goes now if i want the indices of the first two highest values then i'll just put in minus two colon over here and i have six and three right zero one two three four five six so 68 is the second highest value and then we have three zero one two three right so 100 is the first highest value now what i want to do is i want to arrange this in descending order so to arrange this in descending order again i'll put in braces over here i'll put double colon and i'll put in minus 1 over here and i have sorted the indices in descending order now if i take all of this i'll cut this and i will paste this inside of x i'll click on run and this is how i get the first two highest values from this numpy array so 168 are the two highest values from this numpy array so now we'll have to give some examples for creating a data frame from list and dictionary so this is a very common and easy question which is asked in most of the python interviews right so first we'd have to go ahead and create a list and we'd have to convert that less into a data frame similarly we'd have to create a simple dictionary and convert the dictionary into a data frame so i'll type in import pandas as pd so i'd have to start off by importing the pandas library now i will go ahead and create a list so i'll name this list to be equal to l1 so l1 equals 1 comma 2 comma 3 comma 4 comma 5 so we have created our list now to convert this list into a data frame all i have to do is use pd dot data frame function so here we need to keep in mind that d is capital right pd dot data frame and i will pass in l1 inside this and i will store this in let's say data one and i'll just print out data one over here so we have successfully created a data frame from a list where the list values are one two three four and five now similarly we will create a dictionary and create a data frame out of that dictionary so i will name this dictionary to be dt1 and the key is fruit name and the values are apple mango [Music] and let's say orange after this we'd have to create our second key value pair so our second key value pair would be count and the values would be let's say 12 24 and 36 right so we have created this dictionary now again to convert this dictionary into a data frame we'd have to use pd dot data frame and i will pass in dt1 inside this right so we have created this data frame where our first column is fruit name and the second column is count and fruit name comprise of apple mango and orange and the count of the fruits is 12 24 and 36 so now we have this iris data set which comprises of all of these columns so we have sepal length sepal width petal length petal width and species now out of this we'd have to extract some specified rows based on a condition so you'd have to extract only those records where the sepal length value is greater than 5 and the sepal width value is greater than 3. so i'll start off by loading the pandas library import pandas as pd and after this to load a csv file i'd have to use the pd.read csv function and i'll given the name of the file so the name of the file would be iris.csv and i'll just store this in a new object and name that object to be equal to iris now let me have a glance at the head of this data set iris dot head so this will give me a list of the first few records right separate sepal width petal length petal width and species now let's see how can we extract only those records where sepal length is greater than phi and sepal word is greater than 3 right so i'll start off by giving the name of the data frame and i'll put in these braces over here and i'll given the first condition so the first condition is again iris and from this i'd have to select only those sepal length columns where there is greater than five so sepal dot alien cheery h this value needs to be greater than 5. so i've given my first condition after this i'll go ahead and give my second condition and this time i'd have to extract only those records where sepal dot width let me type this out and this needs to be greater than three now let me also put this inside these braces over here let me cut this and let me paste it over here i'll click on run right so this is our list of values where sepal length is greater than 5 and sepal width is greater than 3. if i scroll down you'll see only those values where sepal length is greater than 5 when sepal width is greater than 3 so what we do is we're given the first condition where sepal length is greater than 5 after that we'll use the and operator and then we get the second condition which is sepal which is greater than 3. right so after this we again have this iris data frame over here and we'd have to introduce nan values or null values in the first 10 rows of sepal width column and petal width columns so if you see this original data frame over here you see that these two columns comprise of some values but then again we'd have to fill the first 10 rows of these two columns with nan values so i'll start off by loading the required packages which would be pandas and numpy so input pandas as pd and import numpy as np after this i load the iris data set so iris equal to pd dot read csv and i will pass in the name of the data set which is iris dot csv let me again have a glance at the head of this data set so iris dot head right so now to introduce any n values i can use the np dot nan method so now what i'll do is i'll actually create a duplicate copy of this object so iris one and i will store this data frame into iris one now i'll type in iris dot i lock and i would want to make changes in the first 10 rows and the second column and the second column right so first and rows and the second column so the index of the second column would be one and what i'll do is i will introduce all of the nan values so np dot nan let me put an equal to over here now let me have a glance at the head of this modified data set so iris one dot head right so we see that this is our original data frame and with the help of np dot nan i have introduced any values from actually the first row so let me actually change this to be zero over here i'll click on run so now i have any values for the first 10 records similarly i'll also go ahead and introduce any values in the petal length column so over here i just have to change the index of the column which would be two let me have a glance at the head iris dot head right so now we have to get the number of any n values present in each column of this enhanced data frame so this is our data frame over here which comprises of these columns so we have h bmi hyp and chl and we see that these three columns over here comprise of any n values and we'd have to find the count of the nan values present in each of these columns so i'll start off by loading the pandas data frame i'll type in import pandas as pd let me just wait till the package is loaded right so now that we've loaded the package i'd have to load the csv file which is enhanced.csv and for this i'll be using pd.read.csv function and i'll given the name of the file which is enhance dot csv and i'll store this in a new object and name that object to be enhanced now if i want to get the count of number of nan values this is what i'd have to do enhance dot so i have this s and a function and after this i will just print it out let's see what do we get right so we just get a bunch of true or false labels so wherever there is an nan value present we have a true label so over here in the bmi column the first record this is an n value this again is an n value so wherever you see true values it basically represents all those n values and if i want the sum of all of these nan values i just have to type in sum and now i click on run right so we see that each column has no nan values bmi column has nine nan values hyp column has eight nan values and chl column has 10 nan values now we'd have to open and read a file in python so let's see how can we do that so i actually have this file with the name sparta and it is present in my d drive so let me actually copy the path over here right so this is just the path which i have to copy so first open a file in python i'd have to use the open function so i'll just type in f equals open and this takes in two parameters the first parameter is just the path and after the path i'll given the name of the file which would be sparta dot txt and the second parameter is the mode which i want to open this file so i would open this file in the read mode so again i'll just given double quotes and i'll type in r so r basically means that i am opening this file in the read mode and i'm storing this in this object f now let me go ahead and read this so f dot read right so this is the sentence which was stored in this file this is para and we have successfully read the sentence so let's head to the next question so what is the lambda function and we'll have to create a simple lambda function to add 10 to a given number well a lambda function is an anonymous function and it can take any number of arguments but it should have only one expression and this is the syntax of a lambda function so you'll type in lambda and then you'll given all of your arguments after that you'll put in a colon and then you'll give the expression so let's go ahead to jupyter notebook and create a simple lambda function to add 10 to a given number right so let me just type in lambda and i'll give the name of the variable to be a i'll give a colon and all i have to do is add 10 to whatever variable is sent into this and i am naming the function to be let's say x just a quick info guys test your knowledge of python by answering this question what do we use to define a block of code in python language a key b brackets c identitation d none of these comment your answers in the comment section below subscribe to intellipart to know the right answer now let's continue with the session so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so this is how we can create a simple lambda function now i'll call the function and pass in a number so let's say i'll pass an 8 now this is returning 18 so all i'm doing is adding 10 to the number which i'm passing into this now again let's say 5 pass 5 into this i'll get 15. similarly let's say if i pass 100 i'll get 110 so we have successfully created a lambda function which takes in a parameter and adds 10 to the given parameter so now we'd have to create a simple line plot like this where x and y axis values range from 0 to 10 and the title of the plot is y versus x x label as x axis y label is y axis so simple line plot and we can create this line plot with the help of the matplotlib package so let's quickly head on to jupyter notebook i'll start off by loading the required packages so i would need the numpy package so i'll type in import numpy as np and i would also need the matplotlib package so i'll type in from matt plot lib import pi plot as plt all right so now that we've loaded the required packages let's go ahead and create a data so our x-axis and y-axis values range from 0 to 10 so i will name x and i'll get the values with the help of a range and since the values go from 0 to 10 0 10 and the step factor is 1. so let me just print out x over here and let's see what do we get right so these are all of the values which i have over here so zero one two three four five six seven eight nine right now similarly let me also go ahead and create the y values it'll be the same thing over here it's just that instead of storing the values in x i'll be storing them in y so i have my x and y values to be ready all i have to do is use these data points and create the line plot so p lt dot plot and i'll pass in x comma y and this is my plot over here now i'll also go ahead and add the labels for x-axis y-axis and i'll also given the title pld dot x label so the label would be x axis similarly pld dot y label and the label would be y axis for this after this i'd have to given the title so the title would be plt dot title and x versus y right so we have created our line plot where the label of x-axis is x-axis the label of y-axis is y-axis and the title of the plot is x versus y so it's as simple as that guys so this is how you can create a simple line plot with the help of the matplotlib package so now we have to create a simple bar plot and uh we have these fruits over here represented on the x-axis so we've got apple banana and orange and we've got the cost of the fruits on the y-axis so let me start off by loading the required library from matplotlib i'll be importing by plot as plt after this i just have to create my data so i'll be creating a simple dictionary over here and i'll name this dictionary as data i'll put in braces over here and it consists of three fruits which are apple banana and orange so apple and cost of apple would be let's say 50 bucks after that we have banana and the cost of banana is 20. after that we have orange and the cost of four and just 30. right so now i'll separate the keys and values from this so let me get the keys first data dot keys and i'll get the list of this i'll paste this inside this and let's say i'll store this in an object named as names now let me get all of the values similarly values and i'll be getting data dot values so i have the names i have the values now all i have to do is make a bar plot and to make a bar plot i'll be using plt dot bar and i'd have to pass in the names as well as the values right so we have successfully created a bar plot and on the x-axis we have the names and on the y-axis we have the cost next question so what do you understand by a module in python so when we write everything in a single page it becomes difficult to track and not just this let's say if you want to make a change in a certain place in the project then it would affect the entire project and may prove to be disastrous and this is where we'll be using the concept of modules so instead of writing one big software in one page you would have to break it down into parts so a module basically helps us to organize our python code now let's say you want to write a program to create a calculator now instead of writing all of the features in the same file you can create separate modules for addition subtraction multiplication and division now if you want to perform addition you can invoke the edition module similarly if you want to perform multiplication you can invoke the multiplication module so for every single purpose you can have a separate module so that your work becomes easier so now we have to randomize the items of a list in place in python so let's say we have a list which comprises of these elements so let's say the first element is mary and then we have had a little lamp now i'd have to randomly shuffle all of these elements inside the list and to randomize the items of a list we can use the shuffle function and the shuffle function is part of the random library so i'll type in from random import shuffle so i have loaded the function now let me go ahead and create the list mary had a little lamp right now i will just pass in [Music] this inside the shuffle function now let me print an x right so this is in place shuffling inside the list right so initially the list was mary had a little lamp or the sequence of the elements inside this list was mary had a little lamp and after passing this list inside the shuffle function the elements changed and the sequence now is a lamb mary had little so now we have to write a program to get the length of the string ophthalmology without using the len function and to get the length of the string we can just use the for loop so what we'll do is we'll start a for loop and it will iterate through all of the characters in this string and we'll get the count of the number of characters present in the string so let me name the string so it is o p h t h p l m o l o g y so let's hope this is actually the spelling of ophthalmology right now let me initialize a counter and set the value of counter to be equal to zero after this i'll start the for loop so for i in a what would basically happen is count equals count plus 1 and finally i'll print out the value of count so what is happening over here is initially i's value is zero and it will loop through the all of the characters of the string which is present in a and so let's say the loop starts over here initially i's value is zero and it'll enter o now the count increments by one again it'll head to the next character the count again would increment by one it'll head to the next character and the count would increment by one so till the end of the string it'll keep counting the number of characters present right and we get the results so the number of characters present and the string is 13. so now we'd have to replace all the odd numbers in this numpy array to minus one right so this is our numpy array which comprises of the numbers from 0 to 9 and we'd have to replace all of the odd numbers so 1 would become -1 3 would become -1 5 would become -1 so wherever odd numbers are present all of those odd numbers would become minus 1. let me load the numpy library import numpy as nb after this what i have to do is create my numpy array so a r r equals np dot a range and it will go from 0 to 10 let me just print out this numpy array over here this is my numpy array now let me go ahead and replace all of the odd values with -1 so what i'll do is i will basically divide each element with 2 and see what is the remainder so arr percentage 2 and if it is equal to 1 so what i'll do is i will divide 0 with 2 i'll check the reminder similarly i'll divide 1 with 2 and i'll check the remainder i'll divide 2 with 2 and i'll check the remainder so wherever the remainder is equal to 1 those elements i'll be changing it to equal to -1 right so first i'll divide 0 with 2 and i'll check what is the remainder and since the remainder is not equal to 1 nothing will happen after this i'll divide 1 with 2 and i'll check the remainder so if the remainder is equal to 1 i'll replace this with -1 similarly over here if i divide 3 with 2 the remainder which i'll be getting is 1 and again this value would be replaced with -1 right so the changes have been done now let me prime this this was my original array after performing this step over here all of the odd values have been replaced with minus one one has been replaced with minus one three with minus one five with minus one seven with minus 1 and 9 with -1 now we'd have to perform an operation so that we get the common items between two numpy arrays this is our first numpy array this is our second numpy array now let's actually check the common items so if we look closely at these two arrays we see that two and four are the only two common items present among these two arrays and i'd want to extract these two right so we have created our arrays over here this is the first numpy array and i'm storing it in a this is my second numpy array and i'm storing it in b now to get the common elements i have the np dot intersect 1 d method so np dot intersect 1d and i just have to pass in the two numpy arrays inside this as the parameters so a comma b i'll pass in these two i'll click on run right so i've got the common elements present in these two arrays right so we have a panda series over here and we'd have to convert each of these elements into title case so mary had a little lamp so we see that all of those are in small cases now i'd have to convert all of these elements into title case so let me start off by loading the pandas library import pandas as pd now i'll create the series pd dot series and i'll pass in the values which are basically mary had little lamp right so this is done and i'll store this in let's say s e r so i have created my series i'll just print it out now right so this is my panda series now i'd have to convert all of these elements into title case that is m needs to be capital h needs to be capital a l and l needs to be capital right and as i've already told you we'll be using the map method which helps us to replace or substitute values or all of the values inside a panda series so scr dot map now inside this i'll use a lambda function to convert all of these elements into title case so let me type in lambda over here x colon and i just have to convert this into title case so let me just put in title over here now let me click on run right so we have successfully converted all of these elements into title case now let me store it back to cr now let me print scr over here right so all of these elements have been converted into title case so now we have the same panda series so merely had a little lamp now i have to calculate the number of characters in each word of the series so this is one two three and four so there are four characters present in the word mary there are three characters present in the word heart this is a single character right so we'd have to find out the total number of characters present in each words or each of these elements inside this panda series import pandas as pd let me again create the series scr equals pd dot series and i'll given all of the elements mary had a little lamp so now to get the length of each of these words present in this panda series i'll have to use the map method so scr dot map and inside this i'll again create a new lambda function l am bda a colon and since i have to get the length i'll use the length function and i have to get the length of each of these elements inside a right so we see that the length of the word maybe is of four characters in hat there are three characters a is a single character and in little there are six characters and in the word lamb there are four characters time for next question so again we have this iris data frame and we'd have to change the column name sepal length to s underscore length let me load the package import pandas as pd and i'll also load the file so pd dot read csv and the name of the file is ios.csv and i'll store it back into iris let me have a glance at the head of this data frame so it'll be iris dot head so we have all of these columns over here and i'd have to change the name of the sepal dot length column to s length so to rename the columns of a data frame i have the pandas dot rename method so first i'd have to given the name of the data frame which is iris and then i will invoke the rename method now i'd have to given all of the column names which i'd want to change so i'll type in columns over here i'll create a dictionary and my key would be the name of the column which i'd want to change so i would want to change the name sepal length to be equal to s underscore length so it'll be s underscore length so this is how it goes so iris dot tree name and the original column name is sepal.length and i'd have to change it to s underscore length and i'll store it in a new object and name that object to be equal to iris one now let me just print out the head of this so iris one dot head so now we have to build a linear regression model on top of this boston data frame where the independent variable is this rm column over here and the dependent variable is this medb column over here and the train and test split needs to be equal to 80 20. so this question is basically related to machine learning with python where we are implementing our linear regression model on top of this data set to understand how does this medv column vary with respect to this rm column or in other words medv column is our dependent variable and rm column is our independent variable and we are trying to understand how does mdb change with respect to rm so let me start off by loading the pandas library import pandas as pd right now we'll go ahead and also load up our boston data set so pd dot read underscore csv helps me do a lot of the data set and the name of the data set as boston.csv and i'm loading this file in this object boston and then i'll have a glance at the head of this so these are all of the columns which are present in this data frame so i've got crimson indus cast nox rm and so on and medv is my target and my feature is rm or in other words mdb is my dependent variable and rm is my independent variable now i'll separate the feature and the target all right so pd dot data frame and so from this entire boston data frame i am selecting only the rm column and i am storing it into the x object similarly from the entire boston data frame i am selecting only this medv column and i am storing it into this y object so x would have the feature values and y would have the target value so now i have extracted the feature and the target now it's time to divide this data set into training and testing set so uh the train test split needs to be 80 20 or in other words 80 of all of the records would be present in the training set and 20 percent of all of the records would be present in the testing set and to do this i need the train test split from sklearn dot model selection so i'll type from scalar dot model selection import train test split and this method takes in these parameters so first i'd have to pass in the features and then i'd have to pass in the target so x comma y and then i'd have to give in the test size so a test size is 0.20 so this again means that the test set would comprise 20 percent records and the train set would compress the eighty percent of the records and the values would be stored in extreme x test y train and whitest so x train would comprise of all of the training values or all of the training records for the features and x test is basically the test set for the features y train is the train set for the target and why test is the test set for the target so we have our training and testing sets ready let me click on run over here all right now it's finally time to build the model on top of the train set so from sklearn.linear model i will import the linear regression and i'll create an instance of this so i'll name that instance to be regressor and i will fit this model on top of xtrain and y train or in other words i am filling the model on top of the train set right so now that we fit the model it's finally time to predict the values on top of the test set and to break the values i'll use regressor dot predict and the parameter which i'm passing inside this is x underscore test and i'll store this in y underscore thread now once you've predicted the values i have to find out the root mean square error so i'll import metrics from sklearn and this is how i'll get the root mean squared error so matrix dot mean squared error and this takes in two parameters y test and y print so y test comprise of all of the actual values and y bread compressor for all of the predicted values and i will pass these two inside mean squared error now when i do this i'll get only the mean squared error but i want the root mean squared error so i'll use np dot square root so i would also have to import the numpy library over here i'll type in import numpy as np now i'll click on run so now we've arrived at our final interview question and we'd have to build a decision tree classifier on top of this iris data frame where the dependent variable is the species column and the independent variables are the rest of the columns so separate length sepal width petal length and petal width would be the independent variables and your species column is your dependent variable and the train test split is 70 30. so i'll start by loading the requisite packages which are numpy and pandas so import numpy snp and import pandas as pd then after this i'll load my data set so pd dot read underscore csv i'll pass in the file name rs.csv and i'll store this in the iris object and we have a glance at the head of this data set so these are all the columns present in this data frame we've got sepal length sepal width petal length petalworth and the species column now all of this the species column is our dependent variable and these four columns the numerical columns are our independent variables so now i'll go ahead and separate the features and the target variable so these are all of my features these first four columns so i'll just extract sepal lens sepal with petal length and petal width from this iris data frame and i'll store that into this x object similarly i'll extract only the species column from the entire irs data frame and i'll store it into y object so i have my features and the target ready now it's time to divide this entire data frame into train and test split so i have to import train test split from sklearn.model selection and the stakes in these parameters first parameter are the features second parameter is the object which comprises of the target label and the test size is 0.30 so 30 of the records would go into the test set and the rest 70 of the records would go into the training set and i am storing the results into x train x test y train and y test so x train is the training set for the features extras is a test set for the features y train is the training set for the target and y test is the test set for the target now we'll import decision tree classifier from sklearn.tree so i will go ahead and create an instance of this decision tree classifier and i'll name that instance to be classifier and i will fit this classifier on top of the training set so classifier dot fit and i'll pass in x train and y train inside this so we have successfully fit the model on top of the train set now we'll go ahead and predict the values on top of the test set so classifier dot predict so i'll show the result into y print after this we'll calculate some metrics so we'll get the confusion matrix and we'll also get the accuracy score right so this is my confusion matrix and this is the accuracy so the left diagonal which you see in this confusion matrix all of these are the values which have been predicted or classified correctly so this first row represents the species of setosa second row the species of versicolor and the third row the species of virginica right so you see that all of the species of setosa have been classified correctly when it comes to versi color 16 of them have been classified correctly and two of them have been classified incorrectly and when it comes to virginica 13 of them have been classified correctly and two of them have been classified incorrectly so to get the accuracy we have to add 12 plus 16 plus 13 by all of the values so let me just do that 12 plus 16 plus 13 divided by 12 plus 16 plus 13 plus 2 plus 2. so the accuracy is the same and it comes out to be 91.11 so at intellipad the company we work for is basically a training and an e-learning company so we go through hundreds of job descriptions if it is python we go through job descriptions which require python and gather all the skills which are expected by an employer so that you can easily land that job also as a training company we do not use trainers we rather use working professionals who are working in this particular industry and also gather details and information from them and what was asked to them by their own employer and also what should be taught to our trainees so that we can make them a better programmer and also how to make them basically get a job really easily so with all that details put together we have formed this python certification training course where we'll give you live training projects will give you hands-on will give you all the support to make you the perfect candidate to get into a company into a python role so that's what we are doing here and when we take you on board for this course we will make sure that you learn all of these skills so guys we have come to the end of the session hope you all enjoyed it if you have any doubts please put down in the comment section below we will try to answer it as soon as possible thanks for watching you
Info
Channel: Intellipaat
Views: 43,308
Rating: undefined out of 5
Keywords: Python Tutorial, Python for Beginners, Python Crash Course, Python Full Course, Python Course, Python Basics, Python Online Course, Python Tutorial for Beginners, Python Training for Beginners, Python Course for Beginners, Python from Scratch, Python Programming, Python Tutorials, Python Tutorial for Beginners Full, Python, Python (programming language), Python Language, Python Programming Language, Learn Python, Python Programming Tutorial, Intellipaat
Id: m0oV_xEvvmw
Channel Id: undefined
Length: 664min 19sec (39859 seconds)
Published: Sat Feb 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.