Python in One Go ⚡ APIs, Generators, Context Managers, Modules & Hands-On Projects

GeeksforGeeks · Intermediate ·🔧 Backend Engineering ·1y ago

Key Takeaways

This video covers essential Python concepts, including APIs, generators, context managers, and modules, with hands-on projects to help developers improve their coding skills.

Full Transcript

How many of you have studied Python before? Most of you I would assume or only few of you. Cool. So I have launched my Jupyter notebook. I want all of you to launch your VS code if you are using one. And for people who are not using either of the both, you can just go to your Google and search for collab. Okay. So it is an online ID by Google. So you can use collab. Mostly we use this for data science and machine learning. Okay. So I'll come back to my Jupyter notebook. People I told you don't type it. I'm not going to open your chat. You can speak up. Okay. Now why is Python so popular in today's time? What do you people think? Any idea? No idea people. >> What's the question again? >> Why is Python so popular in today's time? Okay, if I should try. One of the main reason why Python is popular is because of its simplicity and easy to understand and the dynamic. The way it can run >> on on different um the way it can run on different platform and it is easier for it helps it is easier to interpret. >> Okay. Very good. So one of the major reasons is its simplicity and irredability. So if you look at Python code right, it looks almost similar to English. So that it is easy for anyone to understand it. Right? Now the other advantage of Python is it has got millions and millions of libraries. In other languages you have to write many lines of code to get things done. But in Python you have your libraries which is going to make your life easy. Okay. And after all you know any programming language that you study should have a strong community support so that people all across the world use it and you post your questions and people are able to solve them. Correct? And in today's time all of you know there is a huge trend of generative AI all across for your knowledge people when you see data science machine learning AI or geni the only programming language that is used is Python. Okay. Now the first concept that we study in any programming language is variables. Correct. So I just want to know it from you people. What is your understanding about variables? >> Variables are used to store values. >> Okay. Variables are used to store values. Anyone else? It is a name assigned to a value. >> Okay. Name assigned to a value. Very good. Any other answers? There are 37 people almost 43 people and only two three are answering. >> Variable is a container. >> Okay. Variable is a container. And what does this container hold? >> Hold the value. >> Okay. Very good. So in simple terms people variable are like containers to store to store data. Now this data can be an integer, it can be a float, it can be complex number, it can be string, it can be a list, anything. Correct? But in simple terms, it is a container to store data. Now the question is how do we define a variable in Python correct? Now Python is also a programming language same like English. So when you study English you study many grammatical rules right? How do you frame a sentence? How do you use parts of speech? Same way when you study any programming language there are few rules that you should follow. Rule number one. Rule number one how do you define a variable? The easiest way to define a variable is to start with an alphabet. Let's say I have defined a variable with the name A. Okay. And I'm just assigning a value 10 to the A. So how will I read it? A is a variable which stores the value 10. Okay. How do you execute in Jupyter notebook? Shift enter. Or you have this command here called run. The same applies to Google Collab also. Now I have stored a number 10 in the variable A. The same thing if you try to use in other programming language. First you have to define the data type of the variable and then the value that it stores if you use Java or C++. But Python is so flexible that it automatically identifies the data type that is associated with this variable. Make sense all of you? Yes. No. >> Yes. >> Okay. Now I started my variable with an alphabet. Can I start my variable with a number? If I write 5= to 20, will Python accept this? >> No sir. >> Okay. So it is telling cannot assign to literal value. What if I define a variable like this 5 a= to 100? Will python accept it? >> No. >> It shows invalid decimal. Now can I start my variable with special characters? Special character like add the rate add the rate equals to 30. Will Python accept this? No. >> No. >> So obviously there are rules right? There are rules which tells you how to start your variable. So one rule that we got it your variable can start with an alphabet. Right? We are good with this. Okay. Your variable cannot start with a number. But if I start a variable like this x3 = 200 will it take? Yes. Because it is starting with an alphabet. After alphabet you put anything it works. Next. Now special characters are not allowed but there is an exception on one of the special character that exception is underscore. So if I write underscore equals to 10 and I execute so python accepts underscore as a variable name. Make sense all of you? After underscore you can put any number and then again define the variable but it should start with underscore. So till now we have seen two rules. Your variable can start with an alphabet your variable can start with an underscore. Make sense? >> Yes. No. >> Yes sir. >> Now >> yes sir. If you see I'm giving different names to the variable. To this variable I gave the name as a. To this variable I gave the name as underscore. To this variable I gave the name as underscore five. So the names that we give to the variables are called identifiers. Okay. The name that we give to the variables are called identifiers. Make sense? Okay. Now people, rule number three. The rule number three is Python has got some reserved words. Okay. We call them as keywords. So you cannot use these keywords to define your variables. For example, if I define a variable with the name if equals to let's say a name will Python accept it doesn't. So rule number three is you cannot use your keywords to define as variables. Now the next question that you may ask me is okay what are the different keywords? Some keywords are popular. So you know right for, if while. But if you want to get list of all the keywords that are present in Python, what do we do? We import a library. We import a library. Now if you want to import any library in Python, the code is import. You have to write import and then you have to write the name of the library. The name of the library is keyword. So what this library does? This library holds all the keywords that are present in Python. And I'll just print keyword dot KW list. Keyword dot KW list. Okay. Let's see. Okay. Now it has given me list of all the keywords that are present in Python. All of you execute people keep executing with me. The best way to learn coding is to keep executing. You get error we will try to fix it. Okay. Now all of you know Python is a case sensitive language. I have got the keyword as true. So if I write true like this true equals to 20 it executes. Okay. But this true is not allowed. Why? Because this true is a keyword and this is a normal variable. Okay. So, how many keywords are there all of you? How many keywords are there? So, how do we check? So, let's see length of keyword kw. So, there are 35 keywords in Python. There are 35 keywords in Python. Any doubt tell your people? >> No sir. >> Okay. Now some keywords are not that popular. Okay. Some keywords are not that popular like non-local pass. Okay. So if the interviewer is asking you can I define a variable with the name non-local or pass. How do you find out if that is a keyword or not? If it is a keyword you will tell yes it is a keyword and we cannot use keywords to store any data. But you need to find out right. So how do we find out? Let's say let's say he has given you this keyword called non local. And first thing that you are going to do is you're going to check if this is a keyword or not. So how do you check? So we have got a command here people. Keyword dot is keyword. The output of this is going to be true or false. Okay. The output of this is going to be true and false. So what does it give me? It gives me that this is a keyword. So you cannot use this to define a variable. So keep in mind this code. Okay. Is keyword exc of you? >> Yes sir. >> Okay. Next. Next thing that we are going to study is data types. Some of you told me that variables are used to store data. Now what are the different types of data that we have in Python? Any idea people? Any idea what are the different data types that we have in Python? >> Yes sir. It's like uh integer value floats double. >> Okay. Okay. Good. Good. So see here when you talk about data types in Python we divide them into two containers. And okay one more thing people why am I using hash? So hash is used to comment codes in Python. Okay so when you comment a code it doesn't get executed. Comments are just there for readability. So when you share this code with someone the other person can find out why have you written this particular line. Now data types are divided into two categories. You have got primitive data types. Okay. The second one is derived data type. So primitive data types people also identify them as default data type. Okay. Now let us first study primitive data type. So if you all remember in the starting I defined a variable a equals to 10. Now what is the type of data that this variable stores? So there is a simple code to find out the type of data. It is just using type. So do you see it gives me int. So the variable a stores the data type as int. Next if I define another variable what will be the data type of this? >> This is going to be float. So any decimal number in Python will be identified as float. What about this? This is going to be >> string. >> So it shows as str. Okay, it shows as str. Now Python has got one more data type which is none which is rarely used. It is rarely used. Okay. So it is none type. The next data type that we study is complex numbers. So in maths it is a + b i but in python it is a + b j. Okay. So instead of i we use here as j. So it shows you as complex. Okay. The next data type that we have is for boolean. If you check type of this as f, it shows you boolean. So we have got one more. So you have to keep in mind that when you use true or false, the t should be in upper case. Okay. Y. So how many data types should we study? integer, float, string, complex number, boolean and none type. So there are six primitive data types in Python. Okay, can I ask you people one question? Why do we need data types? And why are data types so important in any programming language that you study? Who will tell me? Who will tell me? >> Sir, I think data type are used to simplify our code or make it understandable. And >> how how does it simplify the code? uh like uh in code we have uh anywhere write int then uh if another one can uh read the code they can understand simply like it is integer value also the Python interpreter understand uh easy to Python interpreter have to easier to understand that it's like a integer value >> okay anyone else would like to Sirati >> used to define uh what kind of data and to save in the memory. >> Very good. What data type tells you about what type of data. Next, every data type has got its own size. Right? Every data type has got its own size. For example, int might have two bytes, string might have four bytes, boolean one bytes. So, every data type has got its own size stored in the memory. Okay. Third, now all of you see here, can I perform operations on different data types? If I write 5 + 5, you know, Python is going to give you 10. But if I write five plus what will be the result? What will be the result people? It is going to throw an error. Now why? Because five is an integer and this is a string. So we cannot perform operations. So every data type has got its own operation that you can perform. So when it comes to integer you can add them, subtract them, multiply them. When it comes to string you can perform different operations. So every data type has got its own operations to be performed. Make sense? Yes. No. >> Yes sir. >> Yes sir. >> Next. Now we have studied six data types. So let's do one thing now just for you people to have a basic hands-on on Python. Let's do some basic questions. Okay. So I'm going to write three questions and you people have to solve it. The first question is you have to define a variable to store the total seconds in a day. Second, you have to find out the area of a circle with radius as 5 cm. Third question, find out the simple interest on a principle of 10,000 rupees at a rate of 10% for 6 years. Question number four, you have to find out the distance traveled by a car riding at 50 kilometer per hour for 6 hours. So all of you try to do these questions fast to just give you a basic understanding of how to use Python to solve your mathematical operations first. Are we to solve it on our own engine? >> Yes. >> Okay. >> You can just uh do it on VS Code if you're using VS Code, Jupyter Notebook. If you're using Jupyter Notebook and people, please don't type on the chat. If you want, you can speak up. If you're typing on the chat, I'm going to remove you. If you cannot speak up in a forum like this, how will you speak up when you have meetings in your company? So I I believe most of you are working here or most of you are freshers on this call. Most of you are freshers or working professionals. Aperna Mana Asha pressure >> fresher. So people make it a habit of speaking up in the forum. If you cannot do it now when you attend interviews or if you are on the team call you cannot speak up. Okay. Make sense? >> Yes sir. >> Yes sir. >> Okay. First question. How many of you have done it? I'm done. >> Okay. So, what will you do people? We'll define a variable called seconds. Now, in a day, we have got 24 hours and I have to multiply every hour with minutes. Every hour has got 60 minutes and every minute has got 60 seconds. So what I'll do now? I'll use my print statement. Okay, in Python, even if you don't use print statement, you're going to get the output. But I want this output to be customized. My output should look as total seconds in a day is okay. And then you have to write here seconds. So if you want a customized output, you will use print. Kunal, can you speak up? Don't just type it on the chat. Okay. If you want a customized output, we are going to use print statement. Now there is one more way to print this customized output. If you see here people, first what did I do? First I typed my string and then I used comma and defined the variable. Now is there a way in which I can include the variable inside double quotes only? There is a way we use a concept called format string. How do we define format string? You start with f. And then what will you do? Then you can type your text that you want. Total seconds in a day is now you have to be careful when you define the variable inside double quotes. You have to place your variable inside curly braces. That is how format string works. Okay. All of you. >> Yes. >> Second question. Are you all done with second question? >> Done. So, >> okay. Second question is simple. How do you calculate the area of a circle? The area of a circle is pi. But you cannot use here pi. All of you know the value of pi is 3.14 into r. >> Correct. Print area of circle is cool and you have to mention the unit also write cm². Okay. So I hope you should be able to solve the third and the fourth question as well. >> I I want I have a question please. >> Okay. >> Um when you are writing this square you repeated the five twice. Can't we just use two I two? >> Yes we can use. Okay. So what is it asking people? Now we have got different operators. If I write 5 into 5, what will be the output? 25. Correct? Now the same output. If I want in a different way, what I can do? I can use double asterisk and pass here. So this is power two. This is >> power two. Now don't think if you want to get power three you are going to write asterisk three time okay it is going to throw error okay three asterisk doesn't mean 5 into 5 into 5 so if you want to get 5 to the^ 3 you just have to use two asterisk only and write here Hey, Okay. Now if you don't want to use the value of pi as manual, you want to define it dynamically. So we have a package called maths. Okay. Import math. Okay. And if you want to see the value of pi, you can just write here print pi value is math dot pi. Okay. Can you see you can use it here instead of writing 3.14. So what will you do? You will use here area equ= to math dot pi into sorry into r² 5 into 5. Cool. Yes. No people. >> Next if you see here I was using this power right 5 to the power 2 5 to the power 3. But if you want to use this maths package you can do. So it is simple. So you can just use math.p W. So it takes two parameters 2a 3. What is the meaning of 2a 3? 2 3. Okay you can use this also. 2 raised 2^ 3. Okay, cool. Next. Okay, so this is about simple operations that you can perform. Now what are the other operations that we have in Python? So addition, multiplication, subtraction, all of you know it, right? So we have got one operator which is used sometimes. If I write B percentage A, what will it give me? It gives me zero. Why? >> Okay. So this is called your modulus. This is your modulus operator which gives you the remainder. What about this people? What about this? What this gives you? >> It gives the quotient. >> It gives you the >> quotient. Quotient. All of you agree. It gives you the question. >> Yes. Question. Okay. Next. Next. Now in Python there is a difference between single equals to and double equals to. So single equals to is for assignment when you assign a value and double equals to is for >> comparison. >> Comparison. Right? So if you write a = 10, b = 20, you write a = to b, it should give you false. Okay? So don't get confused. Fine. Now the next operator. So we came across operator. Now there are other comparison operators. A greater than B. All of you know what is it going to give? False. So greater than, equals to, less than, not equals to. How do you write not equals to? Correct? This is how you write not equals to. So these are comparison operators. Now let's see logical operators. Okay. What are logical operators people? or not and or not. So let's take an example. Let's take an example. How do you use them? Now all these operators will be used when you have more than one condition. When you have just one condition, you can use this operators, right? Greater than, less than. But when you have more than one condition, you are going to leverage this logical operators. For example, if I say X greater than Y and Z greater than Y. Correct? I have got two conditions X greater than Y and Z greater than Y. If I execute it gives me false. The question is why? >> Now before you come to the solution, you should know how this logical operators work. So let's see and right whenever you use and obviously you're dealing with more than one condition. If your first condition is true and the second condition is true, the output is going to be true. Apart from this the output is going to be always false. First condition false second true it is always false. Talking about or operator if either of the conditions are true. If either of the conditions are true the output is always going to be true. Are you all aware of this? Are you all aware of this? >> Cool. So if you understand how logical operators work, you should be able to decode why the result of this expression is false. X greater than Y is it true? Is X greater than Y? It is false. And Z greater than Y. So false and false the result is false. The same thing if I try to use or what will be the result? What will be the result? Sorry, >> the result is still false. Why? Because both are false. So let me do one condition as true. So your output will be true. And what not will do people? What not will do? It will just reverse the output of the or condition. So if you use not outside it will give you false because the inside one was true any doubt here? >> No sir. >> Okay. Next concept is about conditional operators. So what are conditional operators? You might have heard about if, else, l if, right? Yes. No. >> Yes. >> Yes. >> Okay. Now, how do we use them? How do we use them? So, first thing all of you know in Python, you should know the syntax for that particular operator. So, how do you write? You start with if. After if what you do you mention the condition. After if you mention the condition and then we use colon. If this condition is true what is the output that you want. Okay. The false condition is optional. You can include it. You cannot include it. But the true condition is always mandatory. So let's do one thing. Let's do one thing. So let me find out if x is greater than y and I want the output as x is greater than y. So if I write here if x greater than y. So the output will be x is bigger than y. Now if you see here people after colon when I pressed enter it did not take me just below the if. Do you see? So I can see a small space here. Let me remove this space and try to execute. So I'm getting an error. What is this error all of you? Indentation error. Now the question is what is indentation? Who will tell me? We have to give some space. >> Okay. Now when you use Python >> block of code, >> sorry block of code blocking if condition. >> Okay. So see here when you use this conditional operators or while using for loop what Python does when you write if Python always sees for the conditions that you want to print after colon. So, Python will always expect you to have some lines of space here so that it knows that this print statement is a part of if. Okay. So now when I keep indentation and execute, I'm not getting any output. Obviously, I should not y because I just wrote for the true condition. X greater than y obviously no. So I didn't say anything about the false statement because the false is mandatory. Now if I wish to include the false condition also, what will I do? >> Use else. >> So I will use else. Else print y is bigger. Correct. So you get the output as y is bigger. Make sense all of you? So I'm going to give you a small task. Now till now all the variables we were defining right now is there a way in Python where we can get input from the user? Yes, there is a way we have got we have got a command called input. So what will I do? input and I'm going to write here as enter a number. Now if I execute this what it gives me it gives me an option to enter the number. So I'll write here 20 and enter. So if you see the value of num it is 20. So the task for you people is you have to take a number as a input from the user and find out if that number is even or odd. Ch let's do this all of you take a number as input from the user and print if it's even or odd. All of you try this question. Who has done it? Manav has done it. >> Yes. >> Sure. >> Okay. So what will you do people? You will take a number as input. Enter the number and then you're going to write the logic. So what is the logic? All of you know if it is an even number it is divisible by two and if it is an odd number it is always going to give you a remainder as one. Correct? If you divide 3 by two remainder is 1. 5 by 2 remainder is 1. So what will I write? If n mod 2 equals to equals to zero. If the remainder is zero, so your number is going to be even correct. else odd. So it is asking you to enter the number. So let me insert 25. What does it say? >> Use type casting >> data type. Use the data type. >> Okay. Now people see here. So you have to be careful while using the input function. If you see here I wrote 25 but the output of this is in single quotes. And if you want to check the data type so what does it give you? It gives you as string and all of you know you cannot perform this operation on a string. So there is a concept of type casting in Python. What is type casting? So type casting is basically converting one data type to another. Now the data type of this number is a string and I want it to be in integer not even float. Correct? So if someone enters 20.5 what will you do? Correct? 20.5. So that is the reason we want it in integer. Now let me try. Let me give 13. So what am I getting? What am I getting people? Odd which is correct? Yes. No. >> Yes sir. >> But there is a catch. >> But there is a catch with this. Okay. What is the catch? I'm going to tell you. If someone is entering zero, obviously someone can enter zero. What will be the output? Even is zero even? >> No. >> So we have to check for this condition also. Okay. What about this people? What about this? If someone enters minus 10 then >> even number >> for negative for negative inteious we don't have even or odd right? >> Yes sir. >> So if it is minus 10 we will write it as a negative even number. So what should I do then? What should I do? How do I modify my code? So I have to write here one more condition and num greater than zero. Yes. No. >> Yes. >> Correct. Now if you see here, now if you write here minus 10, what does it give? It gives you odd. uh gala correct because when you type minus 10 and it goes to the else condition it is giving you odd. [Music] What should you do then people? What should you do? So you have to include one more condition. So your first condition is if number equals equals to zero and number not equals to then it is even correct. Yes. No. I'm just taking the first condition. Okay. I'm just taking the first condition. So all of you know it goes to odd. So I have to write here one more condition in else if correct. Else if else if what? Else if num equals to zero or num less than zero. Then what you want? Then print. Then print what? Please enter a number greater than zero. Yes. No. People is this correct? Can I include this condition? >> Who is using an on the screen? Correct. So it should be equals to Z. Correct. Now let's try. Now let's try minus 10. It gives me even. What I have to do here? What I have to do here? These two conditions I have to add here also. Right? Equals to zero. and num greater than zero. This is for first condition. Correct? Then it will give me even else if num equals equals to zero or num less than zero then this. Okay. Now what do you think my logic is correct? Yes. No people. >> Yes. Now my logic looks good correct. So see whenever you write a logic you should check for all the possible scenarios so that you know your logic does not fail. So what do we call this as you know zero less than zero. What do we call them as? We call them as edge cases where your conditions can fail. Okay. We call them as edge cases. Okay. Now one small task for you people. One small task for you people. I have got three numbers. A = 20, B = 12, C = 22. You have to write a logic to find out the largest number and the smallest number fast 2 minutes I'll give you to this question any doubt till here people who are studying Python for the first time any doubt Aperna Arpan Ashna Prashant Chaitana Franklin Harsha Himesha, Subash, Kaluri, Kiti, Manav, Moan Lal, Napour, Wamsi, Pankage. Any doubt? >> No. >> Okay. Very good. >> Getting it, sir. >> Getting it. >> Yes, sir. >> Easy to understand. >> Yes, sir. Yes sir. >> Okay. Very good. So try this question. >> Okay. >> How many of you are still in college out of this 47 people? How many of you are still in college or in the last year? >> Yes sir. I >> Yes sir. >> Okay. >> Yes sir. >> How many of you are passed out? How many of you are passed out? Okay. So all of you are still in college. Good. Good. So people is this your regular course or you come here only for few sessions? What is it? Manab Swati >> just getting to know how Python work. >> Okay. So this is this is like workshop for you people. They conduct it once in a while. >> Yeah. >> Okay. That's good because college don't teach you everything. Done. Who has done this question? I have done >> Done. Mubarak, have you done this question? >> Yes sir. Yes, I done. >> Mubarak, have you done this question? Okay, let's try to do it. So, what will you do here? What will you do if what logic will you write all of you first? What logic should I write? >> Yes. >> A is greater than or equal to B. >> A is greater than equals to also you're going to include. >> Yes sir. Yes. >> Okay. greater than equals to b is about >> and a is not a is greater than equal to c. >> So when you have more than one condition you should always wrap every condition inside parenthesis and b greater than equals to c. Okay, not B, right? A should be greater than equals to C. Correct. >> Then print A is the >> and then >> L if >> the same thing you will write it for B also. B gater than equals to A >> and B= C. >> Okay. Why are people including equals to? Who will tell me the logic? Why are you including equals to here? If I give all the numbers same 20 2020 20 will it work? Should you use an equals to? >> Tell me. I think >> sir equals to shows >> comparison operator. So >> I know equals to is comparison operator but in this logic should you include equals to? That is my question. If you don't in if you don't include equals to what is going to happen >> I think you should not then it will not include that particular number. it will not include particular number. If I don't write equals to then okay uh so if I remove equals to then what will happen? So so is telling it will not include that particular number. Which number? 20 12 22. Let's say I take two numbers as same. Okay. I take two numbers as same. A as 22. Correct? What does it give? people first. >> Is this correct or wrong? >> It is wrong. >> Tell me >> it is wrong. Why is it wrong? because a and >> I think in Python we don't use single operator in condition if condition or else condition. So that's why >> what we don't use what we don't use >> single operator >> single operator >> okay let us see why are you getting C as the largest okay a greater than B is this condition true people >> yes no >> so this is true first part is true then a greater than c is it correct no so you're using and operator true and false it is false. So it will go to the next line. It will go to Lzip. Correct? We will go to Lip. B greater than A false. B greater than C false. So this is also false. Then it will go to the else. What is in the else? C is largest. So both the conditions are false. So it is printing C is the largest. Make sense? >> Yes sir. Okay. What if all the numbers are equal? Then what will happen? What if all the numbers are equal? Then what it will do? It will go to the last else. Correct? It will go to the last else. Right? Yes. No. Okay. And the same logic you have to write to get the smallest. All of you know to get the smallest what will you do? Same thing. If a less than b and a less than c so you will print a smallest correct. Okay. Any out with this all of you? Any out with this? Okay, let's do one more question. Let's do one more question. The question is you have to take year as an input from the user and find out if it is a leap year or a normal year. It is a leap year or a normal year. So if I do this question first done. Okay. Shiva is telling done. Okay. Before we write the logic, tell me how do you identify a year as a leap year or not? What are the conditions that you check people? What are the conditions that you check for a leap year? Who will tell me? Manab Swati Sony who will tell me >> if it is 29th February. >> 29th February. What about? So you decide leap year on the basis of day or on the basis of year >> should be divisible by four. >> Okay. So okay who is this divisible by four? 400 but not divisible by 100. >> Okay. So we got two conditions. So someone told it should be divisible by four. Okay. If you take the year 2000 it is divisible by four. Someone told 400. Okay. Very good. Fine. Then if you take this year 1900 it is divisible by four. But is 1900 a leap year? All of you check >> sir I I think when we divide with four and 400 it should comes zero remainder should become zero. It's like a condition. Now whenever you formulate the logic for leap years there are two things that you should keep in mind. First thing you should keep in mind is for the century years. Okay, century years and second is non century year. Correct? So when I say century years, years which have got two zeros like 2000, 1800, 1900. For century years, what should you check? for century years you should check if it is divisible by 400 make sense. So if you see 2,000 is divisible by 400 so it is leap whereas 1800 and 1900 are not divisible by 400. For non- century years like 2016 2020 you should check the divisibility condition for four. Make sense? Yes. No people. >> Okay. So, you just need to take care of these two conditions. So, let's try to write it here. Okay. So, tell me what condition should I write? If What condition should I write here? is here >> mod 400 mod what four >> 400= >> okay 400 = to0 okay h again only one condition >> no sir and year mod what equal Okay, that's all. So, print what? Leave here. Let's give some smileys people. What is the shortcut to get smileies? Windows dot. Windows dot will give you smileys. Okay. Correct. Let's see. Uh let me give 2000. 2000 is a leap year. Very good. Let me give 2016. So see here people your logic failed for 2016. So what am I missing? What am I missing? >> Instead of one, you have to do R. Okay. So someone is telling instead of and I have to give or. Okay. So let me fulfill your wish also. 2016 this is a leap year. Okay. Very good. And then 2000. This is a leap year. Okay. 1,800 1800 is not a leap year. 1,800 is not a leap year. So people what do you realize from this? I missing out one more condition. I am missing out one more condition. What is it? >> Okay. One second. One by one. Yeah. Venuta tell me. Yes, there is one more conditioning. >> What should I do? >> Instead of or what should I write? >> 100. Should I write and or or here? >> And >> okay. And then you are telling me include one more condition or year mod 100 not equals to Z >> not equals to zero. >> Okay let's validate. >> Correct. Let's validate. Correct. Let's validate one more. So my condition works people. For century years, this is good. For century years, both will work, right? But for non-century years, you have to take this condition also. It should not be divisible by 100. Any doubt? Any doubt people? No sir. No sir. Now they cut. Then let's move to the next concept. The next concept is interesting. So we have got string, right? We have got string. So let's see some of the string functions that we have in Python. Let's say I define a string here. Okay. Elephant. Now elephant is a single word. But what if I want to extract a particular character from this string? What will I do? So, Python supports indexing. All of you know. And indexing in Python starts from zero. Correct? So if you look at elephant the letter E is present in the index zero and letter L is present at index one. Next thing if you have to extract any character or alphabet from this name you should always be using square bracket and inside the square bracket you should pass your index. So let's see how it works. If I want to extract the first letter of this name, I'm going to pass zero. So see here, do you see it has given me the it has given me the first letter of this name all of you? Yes. No. >> Yes. So we call it as slicing and dicing the string. Cool. Now what if I want to pick up some more characters? I'm just giving a zero and I'm typing three. What does it mean? It gives me all the letters from index 0 to two. So keep in mind the last index is not included. Okay. The last index is excluded. Correct? So 0 1 and two. What is at zero? E. What is that? 1 L. What is at 2? E. Now Python supports negative indexing also. If I ask you give me the last letter of this string, what will you do? You can just pass here minus one. So, Python supports negative indexing also. Okay. Now, another question that can be asked to you is what if I want to find out element sorry the letters present at even index. What will you do? I want to find out the letters present at even index. So if you see E is at two then H and then N >> step size says two sir. >> Okay. So see here now there is one more parameter inside this square bracket. So it is start end and step size. Okay start and step size. So what is the meaning of step size? By default here the step size is always one. So see here my start I'm not giving my end I am not giving I'm just giving the step size as two. What will it give me? >> Dumping another number to >> so it is starting with the first letter E and step size two means there will be a gap of one. So 1 3 5 7 correct but I want all the letters present at even position. So I should start from which index? >> Starting zero. >> Zero is even. >> Yes. >> Zero is even. >> No. Right. I should start from the index two. Yes. No. All of you? >> Yes sir. >> And if they ask you to give you all the letters from even position, you should start from. Okay. Next. How do I find out the length of this string? I'll just use the function. So it gives me there are eight characters. Next, can I convert this string into lower case? So, name dot lower. Let's see if it supports. It supports. Okay. Name dot lower. Next question, people. If I have to find out if my word is starting with a vowel or not, what will you do? What will you do? See here if it is starting with a vowel. So how will you pick up the >> hello? >> How will you pick up the starting >> character? Name of zero right I have to compare name of zero with what all of you and >> okay so a but there are five right so how many times should I do this tell me how many times should I do this or this or this or this or this. So name of this equals to a e i o you correct if this is student then I'll tell you know starts with a vowel else No, mute yourself people who speaking in the background. Correct. So it says no. It says no. The word elephant is starting with a vowel, right? But why does it say no? Well, tell me the reason. Because >> who will tell me the reason? >> Because there string and capital letters. >> Okay. Very good. So here it is capital letters. So from today onwards if you are working with any of the Python string you should always convert that into lower case. Yes. No. Or else what you have to do you have to write here a e i o in upper case so name dot lower correct name dot lower let's see starts with the vowel but people I don't like this approach why so do you see I had to write or conditions four times I had to write this or condition four times. Is it feasible? Yes. No. >> No. >> Then what should we do? How should we modify the code so that I don't have to write or four times? Okay. Let me teach you one more function in string. Now if I if I have to find out if a particular letter is present in the word, what will I do? I want to see if P is present in elephant or not. I'll write P in name. What will this give me? It will give me true and false. Correct? It will give me true and false. Why? Because in elephant P is present. So the best way to solve this question is people define one more string. Define one more string which includes a e i o u. Now what will I do? Now if I write here if name dot this invo invo then does this work all of you does this work? What do you think? >> Yes. Yes it will work. So what it will do it will take the first letter of the name and it will check if that first letter is present in vowel or not. Next question. If I want to find out if my word is starting and ending with the vowel, what will you do? Starting and ending with a vowel. What will you do? We will apply another condition. >> Okay. Another condition. Very good. The question is where where you where will you apply the second condition? alongside the condition with lower. >> Okay. So let me define here apple. So here people n a dot lower zero. So you have to include one more condition right? And after and what will you do? What will you do? of n minus one index one. >> Correct. >> So >> yes >> starts with a vowel and end. Okay. One last question. One last question that gets asked in the interview. Have you all heard about palindrome? >> Yes. So palindrome applies to numbers as well as string. So if the interviewer is asking you find out whether uh string is a palindrome or not. So the meaning of palindrome is when you reverse this string when you reverse this string are you getting the same word or not? Correct all of you? If you reverse this m a d a m are you getting the same string? If you get the same string after reversing this is a palendrome string. Now the question is how do I reverse the string? >> Slicing through slicing. >> Okay. Let's do one thing. Let's take Rakkesh. I want to reverse this string. What will I do? >> Let me store it in another. Huh? Sir, we have to write print statement and indexing we have to two column and >> minus one >> okay two colon and >> oneus >> so I'm telling I'm not specifying the start the end I'm just specifying the step size step size minus one it means it will start from end now let me see B you see it has reversed the string thing. So if I have to check for palindrome, let's do one thing. So how will I write if name >> name >> equals to equals to name >> name? After reversing if you get the same string so you are going to write here print yes it's valid wrong else print no got it so this is one concept that gets asked any doubt sir >> can you please explain palindrome See palendrome means when you reverse this string. So Rakkesh right? If you reverse this string what will happen? H S E K A R this string will get reversed. Okay. >> Now after reversing the string if you get the same string so madam even if you reverse madam you are going to get the same string. So even after reversing you get the same string. It is a palm. Else not. >> Yes sir. I understand. >> Okay people, the next concept is very interesting. So this is a function called range. How many of you are aware of this function called range? How many of you are aware of this function called range? >> Yes sir. >> So what this function does it generates numbers based on the specified condition that you give. Okay. Cool. Now before we study range function, we will study the concept of loops. Okay. What is the meaning of iteration people? What is the meaning of iteration? Who will tell me? If you give the condition, the loop iterates until the satisfy the condition. >> Okay, until loops satisfies the condition. Okay, so I got elephant. Now, okay, so all of you know when you talk about looping, there are two functions that helps you, right? For and while. For is used a lot. So see here first I'll write the syntax of for loop. So how do you write for loop? For after for you can define any alphabet of your choice any name and then we write for i in name. Now in simple terms if I have to explain you what this for does. Now for is a loop. Loop means you start from the first letter go till the last keeps on looping. So when you go from the first and go till the last we call them as iteration one iteration. One iteration is starting to end is one iteration. Again if you do starting to it is second iteration. What this for loop does? Imagine this for loop as a master. This for loop is a master and it has hired a servant. The name of the servant is I. So this master is telling to the servant. You go to this you go to this event whose name is madam. And in this event there are five people. You say hi to all the five people. You say hi to M. You say hi to A B A M and it is telling okay after saying hi to all these people you have to print those names. Correct. You have to print those names. What does it do? >> Indentation error. >> Correct. Indentation error. So what will it do people? It will it will print all the person. So what did this I do? This I went to each person told hi and it is printing. This is how a for loop works. Any doubt? Any doubt? >> No sir. >> Okay. Okay. So if I ask you to print all the letters of the word madam, there are two ways. First way is you are going to use slicing for all. Right? >> Index. >> Correct? You are going to slice it using index. But if the name is very long, will you keep on doing this? Obviously no. In that case, you will be using the for loop to solve this question. So see here for I in name it gives you why will I use range function here? I'm not going to use range function here. Right? My my problem is to find out all the letters. I can get all the letters through I what this zero is doing here that I is doing here. The name of zero is a letter and I is also giving you the letter. But the question doesn't end here. Now if the interviewer is twisting the question, if the interviewer is asking you give me the index as well as the letter. So basically he's trying to ask you the letter and its position in the name. What will you do to solve this kind of question? We leverage the range function. But range function will always work with for loop. Range function always works with for loop. So what this range function will do if you see I have written for I in range 10. So it gives me 10 numbers. It gives me 10 numbers people. But it always starts from zero. >> Zero. It always starts from zero. >> Okay. Now the question is what are the other parameters in this range function? >> Start. >> I want to start with one. If I want to start with one people, it will give me. >> Uhhuh. >> You can give comma. >> So see here 1 to 10. So keep in mind the last index is not included. So 1 to 9. Now if I ask you give me all the even numbers from 1 to 20. Give me all the even numbers from 1 to 20. What will I do? I will start from two. And even the range function has got step size. Even the range function has got step size. So do you see it has given me all the even numbers from 2 to 20. >> Any doubt in this all of you? >> We can print like uh print like what? >> Sir first we print 1 to 10 sir then we multiply with two. >> You want to print 1 to 10 and multiply with two. So when you already have range function, why do you want to multiply with two? Correct. >> Okay. >> Correct. Now when you already have this function, why do you want to take burden of again multiplying? So you're telling here print here I into two. >> That's you already have this function. Either way works. Now the question that I'm going to ask you is give me sum of all the even numbers from 1 to 20. So let me see sum as well as the product. So this is the last concept of the day. We have 10 minutes. So we'll solve these two questions. Let me see who will be able to solve it. Chrys Sir, we can take sir. We can use count is variable to print numbers. of and we can add that entire That's the I have done this. Okay, how do we solve this kind of question? How do we solve this kind of question? Who will tell me? See here people to solve this kind of question we use the concept of initialization. So we always initialize sum equals to zero. Now all of you know all of you know if you want to get all the even numbers what will you do? You will run a for loop. Now after running the for loop what will you do? You'll keep on adding right? You want to add 2 + 4 + 6 + 8 + 10. So you will write. >> Now why did I define sum equals to zero and not any other number? Because see here first time when I = to 2. So sum equals to sum + 2. Sum is zero. 0 + 2 is two. So sum stores what? Two. In the second case, it is 2 + 4. It keeps on doing. So that is the reason I started with zero. And what about product? Product you will always start with one because you are multiplying people. If you take product equals to zero, all your results will be zero. Now I have to come out of this loop. So I'll print sum I'll use f string. Okay. >> F string. The sum of even numbers is sum comma >> and the product is product >> product correct. So see here this is how we start. So this kind of question should always be started with initialization. Now let's come to the actual question. How do I print the letters and their positions in the string elephant? I want the letter and their position. How do I get it? Because there are many questions which can be framed on the similar concept. Follow Sir can I repeat the quot sir? >> The question is I want to find out the letter and their position. So the letter E present at position zero. Now all of you know if you want to get the position there is only one function which can help you. But the question is inside range function you should always pass what? A number. Yes. No. You should always pass a number. So what should I pass here? So how many letters are there in the elephant? 1 2 3 4 5 6 7 8. If I pass here eight, what will it give me? So if I pass here eight, it will give me 0 to >> seven. But this is good. This is good. I got the index. Now is it correct? E. But the question is I want to make it dynamic. I'm not going to manually type it, right? So how do I make it dynamic? What is eight people? Eight is basically the length of the word. So instead of eight, I'm going to use the function length. >> Okay. Now what was my requirement? My requirement was the letter. The letter what? How to find out the letter? >> Name I. >> Ah very good. The letter this is present at index >> I. I >> got it. So this concept helps. Now if they're asking you if they're asking you give me the vowels and their position then what will you do? Correct? The question is they're asking you give me the vowels and their position then what will you do this statement what should we do >> we should apply the same condition as we did before >> okay so for I in range this what will you apply Let's complete this logic people. How do I find out the vowels and their position? >> So I have to combine I have to combine for loop and if loop correct. >> Yes sir. If if name of I in wels >> then you have to print what? Print the vowel is present at index. This is this correct? Is the logic correct all of you? I bet so >> no it is not because >> I did not get anything. >> So there is one more thing we should use the lower method. >> Sorry come again. >> We should use the dot lower method to convert this into lower case. >> Very good. So we should convert this into lower. Correct. Got it people. >> Yeah. >> And I will add one more question to this. The next question is it the first question was find out the vowels and their position and how many vowels are present here. You have to also give me how many vowels are present here. There are three right? How will you get the count as three? Let me see who will answer. >> How many are present? >> H. Now just now I told you what concept will you use? You will use here assignment. So you will start with count equals to zero. Every time it finds a vowel it will add. Correct? Yes. No. Yes. >> Yes. >> Then what should I do? >> So when the count >> count equals to count plus I count plus I. Right. >> Yes. And is this correct people? Is this correct or should I sorry it should be count + one right? Okay. >> What should I do people? So see here the count function is giving you 1 2 3. I don't want 1 2 3. I just want the count as three. So if I want the count as three, I should not include the count with this print statement. Right? Because here it is printing the letter and then position. So what will I do? I'll just take it outside. I'll just take it here. Then I'll write here print correct. >> Yes. No. >> Yes sir. >> Okay. This is how it works. They can ask you anything. >> Yes. >> Okay. They can ask you anything. So the homework for you people is homework is you have to reverse the string. You have to reverse the string and find out the position of the vowel. This is the question number one. The second question is after reversing you have to check you have to check if the position of the vowels remain the same or not. Correct? So now you know the position of the vowel E is at zero. But when you reverse will E be at zero? No, E will be at the end. So these two questions are homework for you. Correct. You have to check for every vowel. Now s just elephant there are three vowels. E e a. Right now you have 0 2 and five. After reversing you have to check if e is present at that position or not. A is present at that position or not. Make sense? certain level of range that that works in you know that works in Java and C++ for I in this I equals to this I ++ correct? >> Yes sir. But if you want your loop to work for a certain condition to do with the iteration here till your condition satisfied it is working for all the letters of elephant letters. It is not checking condition. You go to every letter of this word and every letter of word then it is applying this condition. Okay. Okay. Got it. For it is giving you every letter. Once it goes to every letter correct you are telling okay you run a for loop now you are telling once it finds P loop stop correct you don't want your loop to run through all the letters you are telling when you find P in the elephant when you find P Stop. Correct. words. Correct. [Music] without a particular key. So that's what my question is about. Okay. So, so you want to know the range function max so just about an ide for loop function unbounded file And your 10 GB file has what do you call billions and billions of words but there is no set range defined correct unbounded it goes till the memory now let's say you are having 8 GB RAM billions of sentence billions of sentence 100 million sentence your memory. Yeah, it depends on that. Okay. But many people uses 32. So 64 bit maximum size it goes to billion it goes till 20. Okay. But it again depends on the platform that you are using. HB MacBook has got 16 core bution. Yes. Okay. Okay people. I think that's all for today and I hope most of you are attending the session. Have you people attended any other sessions before? >> No sir. Yes sir, I have module lecture that was Excel or what was it? >> So it was about data analytics. >> It was about data analytics. Good. Okay people. So I think all of you have enjoyed the lecture. So basically I'm based out of Bangalore. I work and I love teaching. So I teach mostly offline for geeks for geeks in Bangalore. I teach data science, machine learning, AI and analytics. And that is the reason I thought of taking this Python session for all of you. I hope you people have learned at least something correct and s >> we will meet again if our paths collide. Okay, generally I'm not available on the weekend but since I was available so I took this session for you and thanks for joining people. Stay in touch. Bye-bye and all the best since you people are in your college. So study well get placed and we will meet again. So my name is Bidhan Sinh. I know the name is not reflecting here. Okay, cool. Fine. My name is Vidhan Sinh and we'll meet again. You can connect with me. >> Cool. Ch. Bye-bye. Enjoy your Sunday. >> Thank you, sir.

Original Description

In this video, we’ll cover some of the most important Python concepts that every developer should master. Perfect for beginners and intermediate learners who want to level up their coding skills in one complete session. 🔥 What you’ll learn: ✅ APIs & Requests – Learn how to connect Python with the web using APIs ✅ Generators & Yield – Write efficient and memory-friendly code ✅ Comprehensions – Master list, dictionary, and set comprehensions for cleaner code ✅ Context Managers – Understand the with statement and resource management ✅ Modules & Packaging – Organize and reuse your Python code like a pro ✅ Hands-On Projects – Apply all concepts with practical examples By the end of this video, you’ll have a clear understanding of Python’s advanced features and the confidence to use them in real-world projects. 💡 Ideal for coding interviews, problem-solving, and building scalable Python applications. 📌 Don’t forget to Like, Share & Subscribe for more Python tutorials and projects!
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from GeeksforGeeks · GeeksforGeeks · 0 of 60

← Previous Next →
1 How I got into Walmart | Shailesh Sharma
How I got into Walmart | Shailesh Sharma
GeeksforGeeks
2 Upgrade yourself In 29 Days | GeeksforGeeks
Upgrade yourself In 29 Days | GeeksforGeeks
GeeksforGeeks
3 Learn AWS Fundamentals For Free
Learn AWS Fundamentals For Free
GeeksforGeeks
4 Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
GeeksforGeeks
5 Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
6 Interview Prep Strategies | PayPal
Interview Prep Strategies | PayPal
GeeksforGeeks
7 OLX Interview Preparation Strategies | Hukam Singh
OLX Interview Preparation Strategies | Hukam Singh
GeeksforGeeks
8 Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
9 Live Mock DSA
Live Mock DSA
GeeksforGeeks
10 Microsoft Azure For Absolute Beginners
Microsoft Azure For Absolute Beginners
GeeksforGeeks
11 Python for Data Science | Data Science Master Bootcamp | Arpit Jain
Python for Data Science | Data Science Master Bootcamp | Arpit Jain
GeeksforGeeks
12 Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
13 How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
GeeksforGeeks
14 Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
15 TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
16 How I Secured AIR 9 in GATE'22 |  Tushar
How I Secured AIR 9 in GATE'22 | Tushar
GeeksforGeeks
17 Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
18 How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
19 Learn Data Structures and Algorithms | GeeksforGeeks
Learn Data Structures and Algorithms | GeeksforGeeks
GeeksforGeeks
20 Interview experience at Flipkart | GeeksforGeeks
Interview experience at Flipkart | GeeksforGeeks
GeeksforGeeks
21 Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
GeeksforGeeks
22 Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
23 Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
GeeksforGeeks
24 Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
25 Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
26 Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
27 Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
28 Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
GeeksforGeeks
29 How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
30 Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
GeeksforGeeks
31 How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
32 Journey from Tier 3 to JusPay | GeeksforGeeks
Journey from Tier 3 to JusPay | GeeksforGeeks
GeeksforGeeks
33 Geeks Summer Carnival 2022 | GeeksforGeeks
Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
34 Dispelling Myths and Pre conceptions of Programming Languages
Dispelling Myths and Pre conceptions of Programming Languages
GeeksforGeeks
35 Must Do System Design Questions
Must Do System Design Questions
GeeksforGeeks
36 Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
GeeksforGeeks
37 Get Hired at NEC | Job-A-Thon 8
Get Hired at NEC | Job-A-Thon 8
GeeksforGeeks
38 Journey from Tier 3 college to Microsoft | GeeksforGeeks
Journey from Tier 3 college to Microsoft | GeeksforGeeks
GeeksforGeeks
39 Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
GeeksforGeeks
40 GeeksforGeeks: Redesigned
GeeksforGeeks: Redesigned
GeeksforGeeks
41 From Tier 3 to cracking multiple interviews | GeeksforGeeks
From Tier 3 to cracking multiple interviews | GeeksforGeeks
GeeksforGeeks
42 Live Mock DSA
Live Mock DSA
GeeksforGeeks
43 Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
GeeksforGeeks
44 DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
GeeksforGeeks
45 GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GeeksforGeeks
46 Journey from JIIT to Adobe
Journey from JIIT to Adobe
GeeksforGeeks
47 Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
GeeksforGeeks
48 Interview Experience at Google | Tech Dose
Interview Experience at Google | Tech Dose
GeeksforGeeks
49 Live Mock DSA
Live Mock DSA
GeeksforGeeks
50 Interview Experience @ Amazon | GeeksforGeeks
Interview Experience @ Amazon | GeeksforGeeks
GeeksforGeeks
51 My journey through the tech world from India to US | Vidushi | GeeksforGeeks
My journey through the tech world from India to US | Vidushi | GeeksforGeeks
GeeksforGeeks
52 Complete Interview Preparation Course | GeeksforGeeks
Complete Interview Preparation Course | GeeksforGeeks
GeeksforGeeks
53 Live Mock DSA
Live Mock DSA
GeeksforGeeks
54 Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
GeeksforGeeks
55 GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GeeksforGeeks
56 How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
GeeksforGeeks
57 LINUX for Beginners | GFG x Itversity
LINUX for Beginners | GFG x Itversity
GeeksforGeeks
58 My interview experience at Walmart | GeeksforGeeks
My interview experience at Walmart | GeeksforGeeks
GeeksforGeeks
59 Get Hired at Speckyfox
Get Hired at Speckyfox
GeeksforGeeks
60 Live Mock DSA
Live Mock DSA
GeeksforGeeks

This video provides a comprehensive overview of key Python concepts, including APIs, generators, and context managers, with practical examples and hands-on projects to help developers improve their coding skills.

Key Takeaways
  1. Learn API basics
  2. Understand Requests library
  3. Implement generators and context managers
  4. Work on hands-on projects
  5. Practice coding exercises
💡 Mastering essential Python concepts, such as APIs and generators, is crucial for building efficient and scalable software applications.

Related Reads

Up next
AI Security: Preventing Data Leaks in RAG 🔓
KodeKloud
Watch →