Python Programming for Beginners: Learn Python in 3 Hours | Ajay Reghu Warrier | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Python Programming for Beginners: Learn Python in 3 Hours

teacher avatar Ajay Reghu Warrier, Making your life Easier.

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

29 Lessons (2h 1m)
    • 1. Promo done

    • 2. Introduction

    • 3. Variables

    • 4. Input functions

    • 5. First Program

    • 6. If statement

    • 7. Elif statemmodent

    • 8. Else

    • 9. First app

    • 10. For loop

    • 11. While Loop

    • 12. Infinite loops

    • 13. Functions

    • 14. More functions

    • 15. Return statement

    • 16. Default arguements

    • 17. Strings Basics

    • 18. Slicing Strings

    • 19. More Slicing and Length

    • 20. Strings Operations

    • 21. List

    • 22. Accessing list elements

    • 23. List operations

    • 24. Conditional Statments for list

    • 25. List Methods

    • 26. More list methods

    • 27. Dictionary

    • 28. Modules in Python

    • 29. User defined modules

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class


This course will not waste your time, Are you tired of watching tutorials that take hours to explain simple concepts? You came to the right place. All this course asks you is 2-3 hours of your life.

Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.

This is the class I wish I had when I was trying to learn Python Programming. I have a unique way of teaching, as I know how it must be overwhelming to learn a very complex programming language. Best part of this course is No prior programming experience is required.

This tutorial introduces the student informally to the basic concepts and features of the Python language and system. It helps to have a Python interpreter handy for hands-on experience, but I have also provided downloadable lecture notes so the tutorial can be read off-line as well.

Python is one of the most powerful yet simple to learn programming languages in the world. What makes python stand out from other programming languages is its simplicity.

Python is mainly used for Web Development, Game Development, and Software projects.

So if you want to make cool websites or a fun game or a groundbreaking softwares. This is where you start - Basics of Python.

I will walk you through everything you need to start writing fun programs. From Installing Pycharm in your PC/Mac to mastering all the key concepts of Python. All that and more in just 3 hours.

You will learn by writing working programs. This course will solidify all the basic Python concepts.

Still not sold?

Here's What People Are Saying About My Programming Courses:

"Excellent Course. Worth every Dollar.

I always wanted to learn python. Few months back I purchased Ajay's C++ course and I loved it. I was excited to see him release a course on python. The course doesn't deviate from topic like most courses on Python. This course didn't disappoint at all. I am only half way in the course, but I am still able to write small programs. Downloadable lecture notes makes the learning process a lot easier. If you are a beginner like me and want to write fun programs on Python fast, look no further and enroll this course"

"Perfect Course for Beginners at Wonderful Price.

Well, I was little concerned about enrolling this course as it was just released, but I have to say it beats all the other C++ Courses in the market. The best part is that it’s just 2 hours, the content is straight forward and doesn't waste your time just as it’s said in the promo video. Worth every buck! Will recommend it to all the beginners."

"Very Good Course for Beginners

This course covers all the Basic concepts of C++ in easily understandable and interactive way. The instructor Ajay is also very helpful and replies readily to your queries and doubts. Overall I would strongly recommend this course to you if you are looking for basic knowledge of C++."

"Excellent Course

I really enjoyed taking this course. I would definitely recommend this course to anyone with an interest in C++. It covers all the basics and good tips are given during the course. Ajay certainly knows the subject he teaches here. Looking forward to his next course."

"Good primer

I'm brand new to Python, so this course was really just what I needed. I would like it to have been a bit longer, and go a bit deeper, but as a brand new Python coder, I really enjoyed it and learned the basics."


Who this course is for:

  • This Python course is meant for newbies who are not familiar with Python syntax
  • Students looking for a quick refresher on Python
  • Someone who doesn't care about the theory and just wants to write cool programs
  • Anyone with a passion to learn something new
  • Anyone who is willing to work hard to learn a new and complicated programming language
  • Intermediate level programmers who are looking to get a clear view of the complex concepts of Python Programming
  • This course is probably not for you if you're an expert programmer looking to learn advanced Python concepts

Meet Your Teacher

Teacher Profile Image

Ajay Reghu Warrier

Making your life Easier.


Spreading Knowledge, Bringing Smiles to faces, Making the world better little by little.

See full profile

Class Ratings

Expectations Met?
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. Promo done: 2. Introduction: welcome to part on programming for beginnings. First of all, let me introduce myself. My name is A J and I have been programming with Python for the last four years. So I'll be your instructor in this, um equals Before we start learning python, there is something that you need to know. You must know why you should learn python. The first reason is that fight on is simple. Pytorch is one of the most easiest programming languages to learn. So why don is a very good place to start if you're interested in learning to code? No. Another good reason is that most off the popular website are made using python. Tell that sides made using python. Are you, too Google Cora pin and dressed Instagram and many more. All these websites by using python. So with that, you know how powerful bite on is. So that is a very good reason to learn, fight on. If you're into Web development and want to make fun websites, python is a very good place to start. If you want to learn python web development or game development or software development, you need to know basics without knowing the basics you cannot learn advanced concept. So that is what the schools does. This goes, will teach you all the basics of fight on in just three hours. It will not waste your time. It'll be straightforward, and you learn to write simple programs in just three hours. So with this knowledge, it will be very easy for you to learn Python Web development, fight on game development or even software development. So I'm not least for the time, and let's that according 3. Variables: Welcome back, everyone. This Lecter's topic is going to be variables Now. In this lecture, we will learn a lot of variables, different types of variables and, finally, how to create variables. No, first of all, what are variables? As the name suggest, Variable is something whose value contained variable is a way off, refering to memory location used by the computer program. Now very well scanned, Assumed is a container. That means it can store something, and the best part about variables that its value can be changed during the program. It can be accessed any time on its values can be changed. As the name suggests, variables are something whose values can be changed. Now all this doesn't matter. You'll understand what wearables are as you start writing programs with it now, before we do that, that is one more thing that you need to learn. That's different types of variables. I know that a five different standard data types in python, their numbers or indigenous strength list pupils and dictionaries. These are the fine main standard data types or fight on No, no first few sections. You'll be mainly dealing with numbers and strings. We're morning list pupils and dictionaries later in the course. So for now, new deal with numbers that is indigenous or strings. Okay, I'll explain what numbers and strings mean with an example. X equals 10. Now this means that X is a variable. And then is the value student that variable? Why equal high? No. Why is another variable and its tools the word high? No X and why I do a variables. But these two variables are different data types. Our X. It's a indigent Saturday because it's stools. An indigent 10 is an indigent excuse. The value of pen in it so X is an indigent variable. No. Why, on the other hand, is a string because it stores a word. Hi is a wood. So anything written in devil courts or single courts in python is treated as a string, and numbers are treated as images. For example, our X is equal to 10. Sir Ken is an indigent. That means X is off, Indigent added, I've and why stores a word in it. So it's a string data type, so words or characters are afford. The strings in tight on No no foot section will deal mainly with this too. Data types. We will learn more complex data types as we progress into the cause. Now let's start making variables in Pie Town. OK, we have our bites, I'm open and now we will create variables. First of all, let's start creating a variable and we'll create in India variable. So we're going to stool. So that's create the variable. Let the variable name V R for variable and let it store the value 101 so variable is off in digital today. Now let's make other variable. This time it will be a string, So let it be named. That's word. By now you will have a clear idea how in India very looks like on the string variable looks like no string variable is inside. Double quotes is how we make variables. Now, another programming languages like C plus flows. He had to specify the data type and fight on. You don't have do that. It does on the work for you. You just initialize your variable and it'll automatically assigned the data type. Now we have created variables. Now let's strike, bringing them to so the print variables. All you have to do is use the Quran keyword, followed by the brackets and typing the variable name. No, let's run this and see if it's working. And in the output screen, you can see how very, very splendid our individual variable splendor and over string variable it's printed. No bringing variables. You don't have to use double courts like we did in a previous lecture. We just have to type the very blame To print the valuable is to bring keyword start brackets inside the bracket. Typing the very blame and fight on will print the variable value on the delicate screen. For example, here very religious one, not one. So in the output screen, we have the value one or one and I will string variable has Hey, I'm a string and you can see Hey, I'm a strength in the output screen. So this is how you make wearables. So that is all about this lecture I'll see in the next letter. Thank you. And have a great day 4. Input functions: Welcome back, everyone. Suppose you're making a calculator and you want to find some of two numbers. You could do that by this initializing values like Aiquile do be called the three Print A plus B. I'll give you the open fire. But what is you on the user to give the numbers you on the uses to set values for your valuables, that is, we're input functions come in handy now. Teach you how to use an input function first to form. You need to choose a name for your very book. So we'll be making a program to print some off two numbers. And those two numbers should come from the youth. So let's do that. Let a be a first variable, so receive input into a only had to do is use and bracket input. You do this and fightin will read input off A from the user? No in the specified here, which means that the input is going to be an indigent. The same may begin initialize a value for B. Now we have received our values from the use of for A and B. Now we need to print it. So let's bring the some of it. It is a les B. Okay, So what this gold means is that able being put it from the user B will be input from the user, and we'll print some of those two numbers. Okay, let's run it and see if the court is working. Okay, Now we can ended in a number. Let it be three and the second number Beef I. And we got eight, which is over require output. Okay, this all agreed the court. The program is working perfectly. But what if you ask your friend to run this for you and you? He doesn't see the code. He just sees the program output. He doesn't know what to do. Like we know the other ones who made the program. So we know that we had to enter a number. But for someone, Ellis, that is a user using it don't know what they had do. So we must specify what the user is supposed to do. So, for that, what begin do is inside the input bracket. We could had a string if you take a look at the code. But this is supposed to do is that instead of just this, providing a space to under your input fighting will no show this string that is, we have written inside this input bracket that is end of the value of first number. Let's run this and you'll have more clear idea. You can see that enter the value of the first number, comes in and begin given our input. And we have space to provided in B five and then end of the value of second number. It can be six, and we get an output at this some. It's 11. No, this program is more user friendly, even someone who doesn't know how to court and fight and can't understand. Whenever you use input statements, make sure they do provide this string inside the input bracket so that the user can have an idea what they're supposed to do now. In this case, he said, the user is supposed to end up number. So be adding that inside this input bracket, a program will become more user friendly. No, this was the one more thing that didn't need new. We can use the Prince statement like this. If you have multiple things to print, you can separate them with the help of cooperator, and you can use it inside the police statement like we have done here. You can do this this way by separating it with the coma ordinance. You can do it into separate print statements. You can simply use a plain statement and separate the text and available you think cooperator or stiffness? Multiple. But in statement like this, the court will with seem so I repeat again, what we learned in this lecture that is, in order to receive input into a variable I already have to do is used the variable name Equal Do End, which is supposed to be type off. The value were enduring that is indigent, followed by input. And inside the input bracket, we taper text that is supposed to tell the user what they have to do. For example, in this case, he has to enter the value of the first number the same way the Value B is also received from the user. And finally, we print some off those two numbers. You'll have more understanding about this as we do more programs. So for now, this is all you need. New. So is he in the next letter? Thank you 5. First Program : welcome this selector. You will be making your very first program. So are you excited? Let's get started. Okay. So this is how fightem interface is going to look like If installed by Tom on your computers. This that would look like no to start off. Go to fire. Include a new project. You can select the location of your project by clicking here and you can select wherever you want. And you can change the name by replacing the text over here. The name it first. Because it's a very first program. You can never do anything you want, Onda. The Fight town will create a project location. All the files of your project will be saved in this first folder after creating your new project were fined again and click on you and you can see options here. Click on Fight on Fire and you can name your file. So we're naming anything. Let it be program. We're going Okay. And this is how screen will look like. No file name is programmed that people, I if you noticed every part on file would have the extension be way. Okay, now to start coding now, instead of bringing Hello world. We'll bring game on this time because hello, Willys. Like boring everyone does. Hello. So let's mix it up a little bit. So to bring onto the screen, all you had to do is this. Go and die. Bring. You can see that by Tom has already done for us. We just have to select from this drop down list and inside the brackets or the parenthesis stand Deborah codes and they will type in game own. Okay, no run. This program will go to the run menu and we'll click on run and this selective program and you can see the output here. This is where you will get the output in Bytom. You can see that game own is being printed onto the screen if you don't want. If you don't want to print game on, you want to print something else? All have to do. Is this change the text inside these chemicals instead of game on? You want to print hello and you can do that only have to do is just change the text inside the clubs. If you change the text to something else If you change the text, Garrett and hey, don't run here. You can go to run tab, begin good run menu and select run. Or else you can just click on this play but in here and you can see carats. So in order to print text in, fight on all he had to do is this type in the print friend is a key word. And inside the two brackets within two naval codes, we will ender ah, prefer text. And if you want to print more text, you can use more print commands. Correct. Sambou, if you enter this line twice, really tried running it again and you can see that the our carrots got print twice. If you want to do it again, you can just Akopian piece to go into get carries three times. So whatever you want to print under the screen, all you have to do is just used to print keyword. Start to rack it inside. Deborah Coats, like the text you want to print is simple as that. The best way to learn python for any programming language is to practice more and more programs. So that is all about this lecture and see you in the next lecture. Thank you and have a nice day 6. If statement: this lesson, we learn about conditional statements. So what are conditional statements, conditional statements, our statements that run according to the outcome off a condition. See if the conditions true, then the falling, said the statement, will be executed. Okay. The three main types of conditions statements and fight on they are the if statement, the LF statement and the else statement. These are the most commonly used condition statements in python. So in this lecture we'll be learning about the if statement. Now the basic logic behind if statement is that there will be a condition. And if the value of that condition is true, then the following said the statements will be executed. No, here is a Florida bad, which was an example. If the value of X is greater than fight, then we'll print the value of X. So this is the logic behind the if condition, that is, if the condition inside the if is true, then the statements inside. If statement will be executed, you'll understand this better as we try out a program. So this is an example and you can see that X equal to Indian put end of the value of X we learned about this in our last lecture. This is how we input value given by the use of into the variable. No, here is our if condition. So we have ah, to use an if condition is the if keyword followed by the brackets inside the bracket, you provide our condition. And if the condition is true, this statement will be executed. Now there's a problem. If positive statements are written like this, that the program will get confused off, which part is inside the statement and which part is not inside in if statement. So that's all that confusion in Piketon whenever you're right body. Often If statement you have to add it. Babs piece Dr Pap space. You just had toe pressed on the tab button on your keyboard. You can do this, monitors. You can press the space, but three times now what this does is that no, we can easily identify which part of the cold is inside the if statement and which part is outside the statement. This is called Indian Nation. So, in order to use the if statement, least if given, followed by the brackets inside the brackets, we provide a condition in this case it is accidental and five. And if that condition is true, I'm evil. Bring the value of X and to identify which part. Of course, inside the statement, we separate the statements inside. If using a tablet in that is well, add at times face now you can easily understand which part of the court is inside the if statement and which part is out outside. They've statement no less than on this program. End of the value of X bill under 16 which is greater than five and we can see that 16 is printed in the output screen is because 16 is greater and fine. So I think if statement, it's clear to you, so I'll repeat this index of the if statement once again do use the if statement we use the if keyword open toe brackets inside the bracket. We provide our condition. Use a full calling. You need to remember this part. The full Colin has to be used not a cynical but the full corner. Then, after inciting here, stabs piece, we write our cord inside the if statement in this case that its print exe Okay, so that is all about if statements, you know, next elective. We will learn about LF statements. I'll see you there. Thank you for watching. 7. Elif statemmodent: Welcome back, everyone. Now, before we learn about LF statements, you need to understand why we need a lift statements. So I had it in a foreign court here. You I'll tell you what it is. First, we will read the value of X from the user. No double equal do means it is a equality checker for a comparison operator. That means it will compare if the value of X is equal to one single equal. Do means initializing that value. Do it produced me protect for a gravity instead of initialization. It will check for equality. That is, in this case, it will check if value of X is equal doing. And if the value of X is equal to one, then only the statements inside the first if statement will execute. So no less Randa's and the value of X bill into the value, too. And we'll get there would be. So Hey, this program is working properly. Where do we need an else statement here? No, it. Anyway, suppose we're having 27 off. If statements like these, the program will take a long time to room Now if we just hellfire statements, But you have 27. If statements like these, the program is going to take forever to run because it just to check if X values equaled one X values even too expensive with the three could prevent that. There's a simple way we can fix this problem. We use the l A statement. Okay, So by using the statement, what happens is that the LF statement will only execute if the if condition is false. That means only the initial If condition is falls, the other conditions will be evaluated. If the value of excess one the rest of the any statements will not execute, only the 1st 1 will execute. Now, if value exists do only these two statements in basic you did you do not check if X values equal to three x very simple before expertly single to fight because we already know that the value of X is equal to two. So I think the concept is clear. What anything does is that it only tics until a condition becomes true all the other. Any statements below the true condition will not execute means. If the second LF is true, then the program will not look if the 3rd 4th and fifth tell if conditions are true. So this way we can say valuable running time off our program. No, it's more programs. It won't make any difference. But in large programs, it will show a last difference in that running time. So repeat what we learned in this lecture. If X is equal to one, then we'll print a and then stop the program. It will not check if accessible to the same way. If the value of excessive will do, then it will stop there. It won't check if the value of X history or excess for what do you think this like? Because fighting already knows that the value of X is two. That is how the else statement works. Do you have more understanding off this as we write more programs using any statements So I see in the next elective. Thank you 8. Else: Welcome back students. Last but not least, we will learn about the El statements. They will understand the concept of l statement with the same court off previous program. So what you do is that let us run this program again. So what this program does is that it'll print an alphabet according to the number we end. That means if they enter one, interpret a if went to dribbling, be if we had a three different see defender four drip in D, and if we end of five, it would bring eat. But having wondered what would happen if we entered six or seven or any other number, let's play. So suppose we ended seven. Let's see what would happen. Nothing happens. We don't have any output. So what can we do to fix this problem that is worth L statements come in handy? That is what else? Statement Come in handy as the name suggest else. That means if all the other comparisons our falls, then only the else statement will be executed. So sure an example. Okay, so we have added an else statement here to add l statement with the else keyword forward by the full college, then attacks based in the Andhra statement. No, if he enter value, which is not among 1234 and fire, it's a bull seven bill, get and put that police inter number between one and five because all abo comparisons our force. So this is going to be able to before statement in case all our conditions fail using If elephant else like this is called if LF else ladder it works like a ladder. So it is called the if Elif else later. Now we'll explain this three off the three of these conditional statements once again. First, the if statement condition will be evaluated. It will check if X is equal to one now. If X is equal to one, it will bring the value A and stop the program there. No. If the value of X is not one, it will check if the valley fixes to now. If the value of excess to then it will print b and stop the program there if LF is used if instead of a lift we have used if then the program will keep on checking if x equal to three executed four x equals five But if you use LF if the condition is true in the program , its job right there, it will not take the rest of that. Any statements? If all of these comparisons are forced, that means exits. Nautical. The 1234 or five. Then our else statement will be executed and it didn't ask to enter value. That is between one and five. No, the concept may be cleared. You And for some of you it may not be that makes clear, but we'll understand all this as we practice more cord with it will be doing that in the coming lectures. So you'll understand how how condition statements look like then. Okay, so that it's not about the selective as in the next sector. Thank you. 9. First app: let them back. Everyone now in this selective, they're going to do something that's really fun. Till now we have been just messing around with Python. But this lecture is the really do. They're going to make our very first real world application. Yes, you heard it right. We're going to make a real world application. We're not going to be a printing hallow words anymore. We're going to making something that is actually useful in this lecture will be making a calculator, and we'll make our calculator using the things we learn till now. All right, so let's get started. If you already checked out the documentation, it's somewhat having idea on how you calculate is going to work. If you want, you can try it on your own. Lawrence will do it together. So basically, this is how calculator is going to work, how cattle later is going to use to numbers, so we must have two variables toe indigent variables. To receive those numbers, you also need a string variable or character variable to read our operator so they'll be needing three variables. So let's go ahead and make those three variables. You can pause the video and try it on your own if you want. So let's make three variables. Okay? Never take a look at the code. You can see that we have made our three variables. No, the US start recap, but input is going to be doing is that it will take a number from the user and store that value in numb one. Now, whenever we don't specify end, that means we just use input. It means that we're going to be reading a string. You already knew that. Okay, so I'll variable Part is done. No, about the operation. So our usable and an operator like addition, operators subtraction of greater whatever and the respect you operation has to be performed and we had to print result. So that means we're going to be needing conditional statements. So let's get started. Okay, They have successfully written very first conditional statement, and here's what is going to do. It will check if our ender operator is an additional operator. That means it will check for the plus sign and IV. It is the plus sign. You don't add those two numbers and it will print the value. So the use of renders the plant's operator. Then it will print the some off those two numbers now the same way we let the minus operator Will and the multiplication Alfredo Angel's in the division operator. No, if you have gone to my previous lectures, you will know that we'll be using LF statements we'll be using the if, LF else ladder for this, we'll be using any statement to make a program more efficient. The program is still work if you use the if statement, but we lose the l A statement for more efficiency so we can write a program in this way if you want. But this will not be that much efficient to reduce. The number of comparisons will be using the LF statement. So let's use the enlisted men here all right, our program. It's more efficient now. It will have less number of comparisons. No, there's one more thing that we need to do. What will happen if operator ended some other operator other than these food, for example, maybe an explanation sign, so we must add an other message to so to add the error message will use our else statement . We learned that no previous lecture you don't remember how to use it. You can go back on. Referred to a previous lecture will be using our else statement. All right, a program is complete. Well, read two numbers will read an operator and, according to the operator, will perform the operation. And if the operator is not among these four, it will print in Valley Operator. So program is complete. No, let's drive running this all right? Seems everything is working. Fine. So let's end over two numbers here. That the 1st 1 with 12. The second number B 12 again. And oops. We forgot to change this one. It should not be into the first number. It should be under the operator. So let's fix that. All right, so that is fixed. Let's try and running this again. First number? Well, second number, maybe 15. This time, Operator. Let it be the addition Operator, that this place and we get the output 27. So we just added over two numbers and we got the old 27. So program is working perfectly. Congratulations. You have made your very first application in Python. Now, this is just the beginning. This is a very basic calculator. You can add more functionalities to this. We learn more features about python. So for now, this is all you need to know. No, no. Next section will be learning about iteration statements. It is a very interesting section, so I'll see you there. Thank you for watching. 10. For loop : hydration is doing something again and again until a specific condition is satisfied. That is what iterations are. Let's learn the different types of iterations in Python. The main to ones are the four loop and the white look. No I Aggression statements are also honest, looping statements. The two types of hydration statements are looking. Statements in Python are for Lou. And while loop so in this lecture will be dealing with four loops. No, first for we need to understand syntax. So here's this index for I in range brackets lower limit to upper limit a full Corrine and the loop body. This is the basics index off for Luke, So I'll explain this better with an example. So I have an example right here for I in range 0 to 5, but I So what this does is that ice value is going to start from zero, and it will keep on Ingram ending until it reaches for not fight still full. So what, we're going to get in the output schooling is that we're going to get 01234 We're going to get this fine numbers printed on to a rope on screen by just entering these two lines of code. So what if I is going to range from zero a Parliament minus one, in this case, a problem. It is five. So the value I will range from Syria before, and it will bring each value. If I So first blueprint, zeroed and been one, then two, then three, then four and then stop. You could do the same thing by using five different print statements like Prince Zero Print one print two in three. But instead of that by desperate writing these Julian's. Of course, you can do the same thing. Now that's a great Now let's try actually writing a program in Pie Town. All right, so we have by time opened up here. We don't write the program that will print off first in numbers, so that's great. Now we could do that in two ways. You can add a new leg, bring zero print, one print to print. Three did it, then you could do that. It didn't work, But there's an easier league we'll be using for loop, so show you how, instead of writing 10 lines of code, I could get the same result in just two lines. Good. So tell you what this does First the value I is going to be cereal. And then it will go into this Luke body and inside the new body, it will bring that value I the current well, if I will be Ciro. So it'll principio then What for look does is that it will inclement this value if I buy one. So a new value. I is one instead of zero. And you print that value one. Then it will increment it again. And the value will become too. And then drooping do Now this goes on until the values I becomes equal to upper limit minus one. In this case, it will go until nine. So let's run this okay for Gardos brackets So that isn't really have fixed it. No, Let's run it again. All right. If you take the open screen, you can see 012345678 until nine. Now, in case you want then in your output You could do that by changing this to 11 So this loop will run until the value of I is equal. Do then. No, There are different days off using for loop instead of using in range. Good for Luke. There are many other ways in which you can use the four, but we cannot learn all of it at the same time. This is a very basic use age off for Luke. There are many more ways in which we can you for looks. You learn that later in the schools. So since we're starting out, this is all you need to know. For now. You know, next lecture will be dealing bit wide loops and see you there. Thank you for 11. While Loop: Welcome back, everyone. In this lecture we will be learning about why Loops? No. I'll explain the concept of while loops with an example. So check out this program first, the end of the value of I from the user. Then we have a while. Looks index here. So this is how the while loop works to use the way. Use the wild keyword. We start to brackets inside the brackets. We provide our condition. In this case, the group will run as long as the values I is greater than fire. All right? No. What happens inside the loop is that it will print the current value of I. Then subtract one from it, then subtract one from it. So in case you have provided the number 10 first, it will print 10 and it'll subtract one from it. That means it will become nine Benadryl, print nine, then eight, then seven, then six. And it didn't stop there because five is not greater than 55 is equal to fight. So the way I look only works as long as the condition inside this bracket is true. So let's find this program and you'll have a clear idea so we had to endure our number. Let it be 10 and you can see the old food screen. 6789 10 First the values 10. It will print that value 10 then into subtract one from it and you'll check if that number Israel and five. That means it will check if nine is greater than five. Yes, nine Israeli and five. So 2.9. Then that I value will be subtracted. They won again so that I value will become eight. And it will check if aid is greater than five. Yes, it is great and fine. So print eight and then subtract one from it. So I value will become seven. Then it will take if seven is greater than five. Yes, seven Slater, in fact. So to print seven also and And make it six and it will come back again. If six is greater than five. Yes, six is greater and five. So you'll print six and make the value if I find no. So the current vilifies five So I didn't take a fight is very than five is far greater than five. No file is equal to fight. That means our condition inside the way I look is forest. So our loop will stop working there and we'll get the final output. 10 987 and six. So that is how the way look works and explained once again you used to a look be used the wild keyword inside the bracket. We provide a condition. Use a full Colin, make sure you provide stab space. No. Inside the loop body, you can provide whatever you want and the loop body will keep on getting executed As long as the condition said why loop is true. This may be a little bit Oh, well, me and beginning. But I still like more programs in sync hydration statements. This concept will be very much clear to you. So for now, this is all you need to know. Okay, So is he in the next lecture? Thank you for watching How great they 12. Infinite loops: before we practice writing more iteration statements. That is something that you need to know. Something that is very interesting. That is infinite loops. We'll be learning about infinite loops. That sounds really fun, right? Well, not really so actually, how it works. So tell you what a infinite loop is. Infinite loop. Keep on executing forever. That means it will never end. So what causes an infinite loop? Remember this previous program we have provided I equal to I minus one, right? Remember that, right? So what would happen if we remove this line? Of course. Let's see. So I had removed that line. Of course. No less driving in this into the number. Let it be, Joe. And you can see that the program. You can check out the output screen and you can see that the program is not ending. Being executed again and again and again and again. Why? It is an infinite loop. So tell me why this happens. First, let me just stop this. Okay? So anyway, this happens. I told you that the while loop will keep on executing as long as the condition is true. So I value is 10 first. We will check if pain is greater than five. Yes, that's good. And fight. So it'll print value 10. Not changing the value of I hear it forever remains 10. So what happens is that you keep on comparing if tennis later than five. Yes, off course, tennis player and fine. So that condition will always be true because we're not decreasing or increasing the value of I. So don't keep on getting executed again and again and again and again. And there is no into this program. So this is called an infinite loop. Infinite loop happens when the loop condition is always true. So that is the reason why we provided and I will do I minus one here. So in this case, the value of I will keep on decreasing. So there is an end. So when did I Value becomes equal. If I or less than five, the program will stop right there. So I think the concept of infinite loop is clear to you. So that is all about infinite loops. I'll see in the next Lecter. Thank you for watching 13. Functions: Welcome back, Everyone in this section we'll be dealing with functions. No. First of all, you must understand what out functions. So water functions functions unnamed, part of a program that can be used from anywhere inside the program. All right, that is the definition. The definition makes down very complicated. So explain functions with a very simple example. If you go to a supermarket, you can find that all the vegetables are kept together. All the electron ICS are kept together. All the kitchen utensils are kept together. All the toys are kept together so that the customer can easily find a product. The same principle is used in functions. The functions is a way off, breaking down a program into smaller components so that the program can be easily modified by the programmer and also at the same time easily understood by the use of so functions are based off breaking down our program into small individual units. Now let me show you an example. With this example, it will be clear to you no. A function has two parts first dysfunction definition, which deals said what the function has to do and the function call function. Call deals with with what values The task has to be done. All right, so the ABO code is an example off a function. No to write the function. First, we start off by typing in B E f E f, followed by the functioning on inside the bracket. We will type in the valuables that they used inside the function. Now this function is to add two numbers, so we'll be using two variables A and B two B. List down those variables inside this bracket. To write a function, use the D E. F G would followed by the function name. In this case it is. Add open a bracket and inside the bracket will type in available that I used inside the function. All right, so this sounds cool, but how can we use this function? There's a problem with this. We don't know the values off A and B, so we must provide the function with values off A and B. No, most of our no. This process is called function called. That means we're going to provide some values to the function so that it can perform the operations inside the function. So I show an example of the function call. So this line is an example. Awful function goal. What it does is that it is going to send the values five and six to our function definition . That means they will be fired and be real basics. So let's run this program and you'll get the output 11 in it. So program is working perfectly. So what happens here is that this function goal will send the value fight and the value. If I will goto a on the right of six will go Toby on inside the function. What they're actually doing is the sum off A and B, so it will add five and six and bring that value. So we got deal put 11 in our screen. Suppose you're working for a computer firm and they asked you to write this simple function so you can easily write it right? No, After a month, they're telling you that you need to add 1/3 variable. So suppose you want to modify this program to three variables. You can do it in split of a second. Only. How does this add one more variable? Do this function a plus B plus the third variable, and in the function call, you must provide one more number. So within split of a second you can expand this program. That means functions make it very easy to modify the program. By now, I'm explaining with a very, very small program here, from one further into the schools and David, larger programs will have a player idea why functions are very necessary. Seville. Run and verify it again and 18 high plus Six plus seven 18. So program is working fine. So repeat our function works. To write a function, use the dft would forward by the function name. Open a bracket and listing the variables that are going to be used in this function. Then use a full Colin after providing a tap space right in the function body. In this case will be pending the some off these three variables toe print a plus B Proceed . Now that is all about function. Definition. No to function Call means providing some value into that function, and that's what we have done here. We will be providing the value 56 and seven to this function. So what this will be doing is that the value of five will go to a value of six will go to be seven will go to see and it will bring the value off five plus six plus seven. So that is how this program works. Now we'll do more examples since using functions, so we have a clear idea on how functions work. 14. More functions: now in your last letter, we were dealing with functions. So we're going to keep on writing more programs and functions so that you have a player idea about functions. So let's light. Another program is in functions. First of all, you must use the D E f followed by the function name. Let's have some random stuff. They'll be food. So function name is going to be food and a full corn. A function name is going to be food because why not empty Brandis is That means we're not be using any variables in dysfunction. And inside the function Let it Let's bring something that's been something out. Chicken burgers for everyone. Yea, listen. All right, So this is how function definition is going to be used. The D E f g word followed by the function name. Oh, parentis is on this. Empty our brackets and it will be empty because we're not using any variables inside this a full Corlin, our tab space and I will function body. All right, now let's try running this. You see that there are no words. Why? Because we haven't actually called dysfunction. The corn in the function is by turns we have seen with internal light. You must to John the light, right? The same thing. You can make a function, but in order to use that function, we must call that function. So the called function, just like we didn't know. Last lecture. We just have to type in a function name followed by that opening and closing off. Bracket will open and close our brackets inside. There will not be any variables this time because we're not using any variables in the function definition. All right. No, let's run this. Yeah, Chicken burgers for everyone. So program is working perfectly, and the great use of functions is that you can You can call it as many times as you want, so you can just copy paste this code. You can just call it again and again on the program whilst in work. See, you are four times this time. So if you're writing 100 line program and after writing the 100 line, you want to do in the car this function again, you can do that without writing the court again, functions can be reused and easily modified. That is the main use of functions. Blood that is all for this example? No, no. Next elected will be dealing with more complex examples. So I want you to dry writing your own functions at home. All right, so that is all about this lecture and see in the next letter. Thank you. And have a great day. 15. Return statement: Welcome back, everyone. We're dealing with more advanced concept of functions. So in this selective, are they going to do it? Said, suppose you're writing a program and instead of this printing the result of your function, you want to store that result in a variable. So what can we do? No, I'll explain with a small example right here. Suppose you opened a food market and according to the order off your customer, you're to bring the price of that item Sheraton, Some part of the function here already we use death with this ever keyword for writing a function of function names order I need You will receive an item which is going to be a string and it will check if this item is equal to Chicken burger. You know, if the item is a chicken brother, we must send back over and you do the function car. So do that. I mean use their done Reduce the return key word. We will return the value one. All right. It's the next step. We must receive the item name from the use of so next. What we must do is we had to call the function will not only be discarding the function, we're going to store the value we're going to store the salt off that function in a variable. So to do that, we'll create a variable result. It can be any name, but for the time being introduced himself. And this is decided my store, the result off the function. So to do that, we must function call. So we had to function call with the value given by their user. So in this case, presented equal to order I am name. So this is our function call. So what this will do is that it will send this item name, which is going to be the item name entered by the user. And it will check if that item musical chicken burger. Now, if the item is equal the chicken burger, it will turn the value one. So what that means is that if you send back the value one do this function court, so will result will be equal to one. So let's pretend the salt value so that you'll have a clear idea of Annville on the program . Look. Okay, so the last part is that we're going to take that If the result values one, it must print the price off over off our chicken burger. So let's do that. All right. So if the result, while is equal to one, will bring the price, I also point out thank you for shopping. All right, so program is complete, no less. Driver in India's. All right, We have to enter our item name. So let's end a chicken burger. All right, we'll check out the open screen. Result this one $5 can give shopping. So program is working perfectly. So the 10 giver is used to send back a value do the function corner. This is used them going to store the result of a function into a variable so that data can be used anywhere in the program. For example, this case, then we'll run this again. And if we're typing something else, for example, maybe french fries, french fries recited is none. That means there is no french fries. We only have chicken burgers. So this program is only going to work. Even the indoor item is chicken burger. No, I havent smaller Simon for you. Add one more item. Expand dysfunction for friend phrase. So that it works if then put his friend fries. So for that you can just add one more conditional statement and take if the item is equal, different fries. If the item is equal to friend fries, return to or some other values to the one and then stole that living another variable and check that variable value is equal to equal to the return value. So I think the concept of return is clear to you. We'll do more programs with it, and you'll have a better understanding of this. So don't worry, it's not clear to you right now. It will be clear to you by the end of this section. So thank you for watching and see him the next Lecter. Have a great day. 16. Default arguements: Welcome back. Everyone in this lecture will be learning about default arguments. No learning the concept, duty, fold arguments is very important. So before we learned that, you must understand why we needed So I'll explain to you the need off the fort arguments with a very simple example. We're going to use a real world example. Suppose you have made us all from game. You have made a game and you have uploaded to steam Amazon and also to online markets. I suppose it's born Amazon, and, uh, customer comes in and he likes you game and he wants to buy it. He wants to buy one for himself, one for three other friends office. So he comes in. He selects a number off copies as full. Assuming that game prices $40 he selects four copies. He can immediately see that the torture price has changed to 1 $60. Great, right? We had it in a very small program. For that, we have defined a function price and it receives in a variable Q t y, and it will bring you tea y into four p. Which 40 surprise for one game? One copy. So in this gave the user has centered fool, So he will get something like this. Prices 1 $60. Suppose the customers in a hurry. He is very excitable buying your game. He forgets to end of the quantity. That means he forgets to under the number off copies. So in this case, what would happen? We'll run this. You can see that we get another because there is no quantity ended. So what will we do? So how can we solve this problem? There must always be a default argument, a default value in case the use of forgets to under his input. In most cases, when I will be a buying something, most people would be looking to buy this one off. One quantity, right, One copy of it. So the default value should be one. In case the user forgets to enter the quantity or number of copies. The D four value should be one. So how can we do that? It is very simple. I'll show you how here is a function definition and we have provided that beauty. Why it will be the variable will be the variable that we're going to use inside the function. So to give it a default value. All you do is inside this bracket beaut y equal do. One, in this case is one because one will be over default value. Now let's run this. You can see that it works and we get an output. Price is equal to $40. So even if the user forgets to enter the quantity, he will still be able to move forward. So I think you understood the need off before documents. I'll explain again how toe give a default value. So in this function definition, usually we just given the variable name. Right now, we're also giving in this case, we're also giving the default value off that variable. That means we're giving the variable equals one. So in case no other value is provided to this function, it will operate with this one. No beholder. If the user has ended for we still get 1 60 because we have a value for Q T wife. So in cases where there is no value for Q t y, it will treat one as the value. So this way, even if your customer forgets to enter the quantity instead warned, because the quantity by default will be one. So I think the Ford arguments that clear to you. So that is all about this, Elektra. And see you in the next letter. Thank you. And have a great day. 17. Strings Basics: Welcome back. Everyone in this electoral we're going to be learning about strings. They're already given introduction about strings in our very first section. Now we're going to learn about strings in detail, people. The shot recap on what strings are no strings, a collection off characters. Basically, there's a bunch of text or sentences or words collection of words or characters of any sort . Now they must always be inside single coats or double codes. Always remember anything inside double courts or single codes is a string. And if it is not inside the court, it is not a string. So all this remember that? No, another important thing to remember is that whenever we count the number of characters off a string, the counting starts from zero. They never be dealing with computer stuff. We always gone from zero not from one, but from zero. So suppose we have a string peak. It's you is my favorite Pokemon. The counting. All these starts from zero. Whatever string it is, the counting is going to start from zero. So in this case, when we counted normally, the rest seven characters like B. I gave a C as you seven but in programming languages, whenever we're dealing with the computer recounting from 00123456 means there are the six characters and the accounting from zero to remember in strings. Then become the number of characters we accounting from zero. All right. That means this three road letter off our string is be the first of this. I the second lead risque. You get the you get the point, right? All right, Now there are ways in which we can use that inside our program. So show you that. Okay, so we have opened up a Bytom here. Very, very cool. Now a equal do a equal to pick it. You we care. All right. Very, very cool. No, in case we just want to see the first letter off a string. So to do that, all they had to do is friend. Hey, then we use the square bracket, remember? We're not using the Miranda says we're using the square bracket. A zero. I already told you, which is a road character in the string? Yes. Be So now let's run this and check if it is working. Yes, in the old quote screen be it Be now, in case between this little 21 let's run this again. We get I. That means our second character was second letter, maybe one. The fifth character. The food letter to print They select a inside the square records five. We run this we get at so we can access individual letters off a string by using the string names the string variable name square brackets, the number off the character you want to print in this case five. And we get that very, very cool. Remember, the counting starts from zero. That's very important. Remember that always that is the basis of string. Now, whenever coming electors were going to deal more about string, We'll see you there. Thanks for watching and have a great day. 18. Slicing Strings: Welcome back, everyone. We were talking over the cool things even do with strings. So in case you provided minus one inside the square bracket off a previous program from our last lecture and we run this, we can see that the garden last election. Last character. So, in order to get the last character or the last letter you can use minus one No, to get the second last letter, you can use minus two and you'll run this and we get which we just have a second last letter. If you want the third last letter, we can just change this to minus street on we get C. So I think that is clear. Whenever you use minus that, it's negative numbers you can read. The string from backwards minus one means the last letter minus two means second last letter and so on. There's a very cool feature off strings. You can slice springs. Yes, Like Mr Lies an apple. We can slide strings. So first ensure real example off slicing strings. So suppose this other string pickets you here. You just want some part of picket you to be printed, for example. Just pick apart. Okay? You just want the 1st 4 letters to be printed. So to do that very, very simple. I'll show you how zero years of full Colin up to four zero full calling for Let's see what happens. We'll run this, and we just got the peak apart. B i k a part. So what does this is that it will print all the letters from zero to upper limit minus one . That is pseudo toe three white, three. The counting stats 13 right. So if you absurd of a previous presentation what? This that's is that zero zero letter that it's p first letter. That is I second letter. That s K on the third letter. That is a B i D e a. So it just prints out those four letters for me. It will only print up upper limit minus one that is four minus one. So the 1st 4 characters we'll be printed. Zero full Colin four will print out the 1st 4 characters. Now, if you wanted the 1st 5 zero full calling fly, we'll run this. And we got Pekka, See? Very, very cool. Now what if you just don't You don't want to start from Syria. You wanted to start from one in that Gays. It is very simple. One full. Colin. Andi, whatever is the upper limit. Let it be six. Let's run this. You get in the output because the printing will start from a one That is our eye. All that they upper limit that is six minus one. That is the fifth letter. What is her fifth letter it is at? So it'll print all the letters from I to get No to get a clear idea of slicing or springs. I want you all to try this at home. The more you practice this more you understand this concept. So just right down a symbol string and try to slice it in different ways. The concept is very simple. The string letters with depended from the lower limit toe upper limit minus one. It'll print letters from the first letter all the way to the fifth letter. Very cool, isn't it? So that is all about slighting or springs. I'll see you in the next lecture. Thank you for watching and have a wonderful day 19. More Slicing and Length: Welcome back. Everyone we were talking about. The cool features are strings and there are plenty more. Okay, so we learned about slicing or strings there More ways in which against lives in games. You just provide a full calling inside the square brackets, your unders and you can see funny. You can see that the whole string gets printed whenever you just put in an empty full Colin without any numbers in it, it will. This friend out the whole string, just like usual. Nothing will happen. No. If you bring without providing any lower limit just the A parliament part fire without any lower limit here. Just the upper limit. We'll see what happens. It will print the 1st 5 letters. The first fire starting from zero at the suit of Little Forest Letter, second letter, third letter and fourth letter. The 1st 5 that is upper limit minus one up to a parliament minus one. All the letters will be planted. That means the first fire letters. We're counting stats from zero. They want to print up the six. You can just write in six here on running again and you get the 1st 6 letters. No, You can also experiment without the upper limit. Just the two here. That means we have a lower limit here. So what this does is that it will print all the letters from two until the end off the string. That Mr is no appeal limit. It was going to print until the string ends. So it will bring all the letters from the second letter all the way up to the last letter off the string. If you want to start bringing from this three, then you can do that. So from the third letter to the end of the string and that the bite third letter, you must always remember that the counting is starting from three year old. I say that again and again. So that you doing forget on end up going from one and missing of your program. So this is all of which lighting the strings? No, there are many more things that you need to understand about strings knows that always you have a string and you won't find out the length of that string. There's a very simple way to do this. Now. The best part of a fight on is that it has done all the work for us. We don't have to do all the hard work. Most of the work is already done by Python. So suppose you want to print the length off this string so there isn't already made a function for this called l E. And no, if you type in Alien, Uh, Brandis is inside the Prentice's. We just type in the name of for string. In this case, it is a I know if you bring this if it bring this, they see what happens. We get seven beauties our length of string that are seven letters in this world. Pick it. U has seven letters. So you're playing down seven. That means you get the length off a string. You can just type in l E and open to brackets inside the brackets. Provide the variable name. If you don't want to print this name, you want to store it in variable. You can do that. We can make a variable length equal do. It can be any name. In this case, it is lent length, equal toe l E and off A. That means length will get the value seven because length off 87. So it will get their radio seven. No, everyone, you can bring this length again. We run this. You have the same old food. So to get the length of a string only had do is this type in l E N open two brackets inside the brackets. Type in the variable name. All right, so that is all about this letter on strings. We'll practice more examples with strings. I'll see in the next lecture Have a great day and thank you for watching. 20. Strings Operations: Welcome back, everyone. We're learning about the cool features. Off strings. During this lecture, we learned something very interesting. Okay, No, there is something called string operations. That means you can perform operations on string. So let me show you an example. Okay? So if you want, have you wondered what would happen if we add two strings? For example, Me ringed Pekar. Bless Peak. What would happen if we printed this? What do you think? We get the output? Peka peka. That means it will just join those two strings into one single string. These two words get joined. No, I will show you a better example. The wow tight on. Let's run this. You run this function. Okay, so we combined these three words. That is we well and pipe down into one single. Would we allow pattern? So if you want, we can just provided space here and we don't look better. No, let's win this. We allow fight on now. It looks like a complete sentence. Be combined Three words using the plus operator to make a sentence. How cool is that? You could do the same using three different variables. You could do that a going to be going to see equal to a cool to be bqool to allow I see equal do By dawn. I used it off, adding these we could simply add a plus B. Let's see. No, let's run this and you get the same old food so we can either add them as strings or give those spring values to a variable, and we can add them. And it will combine those strings into one single string using a work bless operator. So there is one more operation that you can do in strings that is the multiplication operators. Very, very simple to do. Let's change our string here for this instance. Let it be again. Pekka Space here and here's so that are out looks good, eh? Multiplied by five instead of the addition this time they're multiplying. Any idea how the output is going to look like Let's run difference. See, we God fly Peca's Okay, Bicker, bicker, bicker, bicker, bicker. So, like the additional operator multiplication operator can also be used to string to repeat the string as many times as we want. In this case, we printed out the string five times by multiplying it but fine. If you wanted to be bringing 10 times, you could do that by using a in do. Then we ran this and we get speaker 10 times. So that is how the multiplication of greater is going to work. So we learned about two operations. Addition, operator and multiplication. Operating additional bread abuses to combine strength and multiplication. Operator is used to repeat the strings a number of times. So that is all about operation on strings. I see the knife. Lecter. Thank you for watching. 21. List: Welcome back. Everyone in this section we're going to learn about list. No list. What a list. No list can be treated as a group off similar objects. It's a collection of similar objects. A list is a way off grouping simple objects like you can have a list of colors, and then inside that list, you can have all the colors he won. And by using the name of the list, you can access all the colors inside. The best part of the list is that it helps in reducing. The court says Okay, so they have opened up our pie time here. No, to make a list. It is very, very simple to make a list. We type in the list name, and then we put the equal to sign inside square brackets. Remember, it is not. The parenthesis were using the square brackets, the listing the elements off our list, separated by a coma. Suppose you are making a list of numbers from 1 to 10 to make the list. It is very simple. One comma, two comma, three coma, four comma five on all the weapon Can you can make a list off the 1st 10 numbers in this case were made a list off the 1st 5 numbers. It is very simple to make a list. Just open a square bracket inside the square bracket, typing the elements off your list, separated by a comma. Remember the calm apart. Then we just closed that list. So we have made a list year. Now let's stripe bringing this list to print this list. It is very, very simple. Just type in print and inside the bracket. Type in our list. Variable name. Now is the name off the list civil type in print? A. No, let's run this on in the old port screen. You can see the list here. 1234 and five. Now this is a list off numbers if you want. You can also make a list off strings. Strings are basically text. Our last section was horrible strings. Do you already have an idea on how strings work? So now we have made a list off five colors? No. If you bring out colors in the airport screen, we're going to get red, yellow, blue, green and white. So this is a list off colors. Now, the main use of list is to reduce the code size. Now, instead of making colors one equal red color to equal to yellow color. Three equal to blue collar for Nickleby, blah, blah, blah. You can just make a list off all the colors and use a single variable name to access all those colors. So this is a very good way off, reducing our code size and simplifying our program. So I think by now you have a player idea on how to make a list. Now let's learn about some features off list, so I'll see in the next elector, Thank you and have a great day. 22. Accessing list elements: Welcome back, everyone. Now in the selector, we're going to learn more about list. I'm in a previous Lecter. We learned how to make a list to make a list. We have the name off the list equal toe open square brackets and type in the elements off the list. Separated by a coma. We already made a list of colors and we have fi colors inside. Very, very cool. Now, the best part would list is that you can access each element by using the same list. Name. So this else introducing courses? We talked about all that. No previous elected. Now, in this Lecter, we will talk about how to access each element off a list. So don't do that. Just like strings. Be typing the list name. In this case, it is colors. We open a square bracket inside the square bracket. We type in zero to access the first element off the list. Now, let's run this and we get the color red. Very easy, isn't it? We just typing the list name. Open a square bracket inside the square bracket. Type in the number off the element you want to access. I already told you when we learned strings that counting starts from zero. So no taxes. First element type in zero to access the second element. I've been one. Let's run this again Yellow. It means he got the second element. So the access the third element, you can type in two well renders and we get boo. So you get the point, right? Very cool. Now, the same way as we slice, there were strings. Begin slice our list. So if you use a full Colin without any numbers, it will print out the entire list. You can see here in the output screen the same way the slice strings because size list with lower limit one and apple limit three. That means a list will bring from first element all the way up to second element. That is upper limit minus 13 minus one is too. So it will print all the elements from one to do so for Salman is yellow and the second element is blue. So let's run this and we get yellow and blue. Very cool, isn't it? Yes. No. Suppose now all the slicing that you can do on a string you can do on a list? No, Without any lower limit, we just put in the A parliament. That means it will print all the elements up to our upper limit minus one. That means up to our second element. It will bring all the elements inside the list up to our second element. We'll run this and red, yellow and blue. So the same way you can skip in our A Parliament and just provide the lower limit, but will print out elements from our lower limit to the end off the list. So in this case, the lower limit is two. Our second element is nothing but blue on the reason open limit. That means it will print out all the elements from Blue. So let's run this. We are on this blue green and white it. If you have a clear idea on strings lighting, you'll have a player idea on Let's slicing because both work on the same concept. So that is all about accessing list. Now, in our next lecture, we will learn more about list, so I'll see you there. Thank you for watching and have a wonderful day 23. List operations: Welcome back. Everyone we were talking about listing no last lecture on. We're going to continue doing that now. If you want to make an empty list, all you do is type in the list. Name this example. It's empty. Equal. Do opening and closing brackets on. Don't write any element inside it. Now, this is how you make a empty list. All right, so, no, that is out of the way. We're going to learn about the list operations. This is an example off the addition operator. So what will happen in this case? We're changing the colors list into colors list. Bless these two elements. Now, if we print colors, what will happen? Let's see and check out the old Oh first list. Waas red, yellow, blue, green and while it our second list waas red, yellow, blue, green while it white and orange. That means by using the plus operator, you can add more elements to your list. So what this line of code does is that it will abdel variable colors do colors place that means already elements inside the list bless do new elements that is white and orange, so the plus operator can be used to combine the elements off our list. This, like you know, string operator will be combined. Different words using our plus operator, we can combined elements off a list using the plus operator. Very cool, isn't it? So that is all about operations on strings? No, no. Next electoral. We'll talk more about list, so I'll see you there. Thanks for watching and have a wonderful day. 24. Conditional Statments for list: Welcome back, everyone. We were learning about the fun features of list. No, here is a very cool feature. It is very important and can be very useful. So take a look at the program in your screen. It is very easy to understand the working on this program if you're very clear with conditional statements and list. So tell you what this does. When I was teaching you conditional statements and iteration statements, I told you that there are different ways in which we could use them. So this is are very differently in the to begin use conditional statements. So what this does is that we have a list here. It has three names in it. Larry, Curly and move. So what? This program, this is that it will check if girly is part of the list. It will check if girly is part of the list. So you knew that used if and in keyword. It is just like when we write descendants. If girly in list. That means if Curly is in list friend yea girl is in the list. We can use the in keyword along with our if keyword to write conditional statements in list . So this is a very fun feature. You can try this out. We can do the same. That numbers instead of a string list. We have a list of numbers if do in the list. Yea, to is in the list. Okay, let's run this and we get the output. A two is in the list. So in this case, we made a list off three numbers and if do is part of that list it will bring you to is in the list. So this is how we can use conditional statements in list. So that is a very fun feature about list. And this can come very handy a times. So basically what this is is that if the element is part of the list, then that condition body will be executed in this case, it will print out. Year two is in the list. So that is our about this lecture. I'll see in the next elective. We talk more about list. Thank you and have a wonderful day 25. List Methods: Welcome back. Everyone in this lecture we're going to learn about, lest functions or list methods. Nope. Eitan has already defined some functions for our list. I already told you that the best part of Fight on is that it? That's most of the work for you. There are many really find functions in bite on that make the usage of list very simple and very efficient. So we're going to learn about some important list functions or list method. So in this lecture, we're going to learn five off the most important, lest functions or less method, they're upend, insert removed, sort and reverse. We'll be learning these. Fine method it. These are the most important and most useful methods off list, so let's learn each of them. I shall explain all these methods with the help of an example. Suppose you throwing out a party for your friends and you want to make a list of all the friends who are attending your party. All right, so party members. So we have a variable party member, which is the list which will contain all the names off the friends we're inviting for your birthday party. Most common practice when we make this is that we start out with an empty list and then we append each name to this list so that start out here. I'll show you how a pending works use the app in function. We type in our party member, which is a very blame dot We used the dot operator and from this list you can select append and type in Oh, first name. So let it be. Yeah, okay, Castle. So list waas initially empty list. It didn't have anything inside. No, we have upended Castle into the list. Now let's drive bringing this and let's see what happens. You can see that the list is no longer empty. Gasol is part of this list. So in order to enter an element into the list, begin use the app and keyword. No, let's happened a few more names into this to upend. We type in the list variable name, dot append and inside the bracket type in the element we have to add to the list. So let's add another name and we'll print it again to see what happens. No, let's run this. No. First we had empty list. Then we added Gasol to it. And then we had a house to it when it's used to add a new element into our list. So we had to elements into a list using the app and queued. So I guess the uses of upend is clear to you. Now. The next function, we're going to learn it's insert. So I show you how that woods okay, using insert is a little bit different from upend. What inside this is that we can also specify the index, which we would like to add the element nobody has happened. It is added to the right side. We cannot specify the location to which we want to enter our element. No insert. I lose us to specify the index and also element. Let's run this and you can see no, that the news insert zero. That means the pseudo position. We have a new name that it's Patrick and in shifts all the rest of the element to the right . So a new zero tele minutes Patrick and a new first Adminis castle and a new kind element tells so by specifying the index we can add our name Very good. Upend this name, but that would take it to the third position. We cannot specify the index when we use happened, but when we use insert, we can specify to which index value. We want to add our new element. So in the coming, electors will be dealing with more list functions. So until then, stay tuned. I'll see the next lecture. Thank you for watching and how wonderfully. 26. More list methods: Welcome back, everyone. You know, last lecture we were learning about lift functions or list mattered? No, they didn't learn some more important list methods. So we learned about inserting element into a list. Now, there is something that you need to know. We can also remove an element from a list. You making a party? Let's remember you made your list. And, God, Castle housing patterns. These are three members Were winter turned your party, but suddenly house calls in and tells you that he cannot it in the party. He had some other plans, and he cannot it in the party. So you want to delete his name from the list? How can you do that? You can do that by using the removed method by using the movement of same way like to use the other list functions we type in the list Name list. Variable name, Dr Remove. And the name and the element which you won't remove. In this case, it's house. So let's remove house when this edge Oh u s Okay. Now, let's bring this again and see what happens. Okay, let's run this. You can see now that health is no longer part of her list. We just have Patrick and Gasol in a list, so remove an element from the list. All have do is type in the very believe that it's the listening doc removed and the name off the element which you want removed. Now, in this case, it's a string. You can do the same thing with numbers if you want. Okay, so we learn three methods of three functions. New England. Our fourth method, which is going to be very interesting. Let's see what happens. So suppose he want to reverse this order. How can you do that? You can do that by typing in the list. Name dark rules. And we need not provide any para middle inside dysfunction. And you can see that our list has been removed. Check this out. It was Patrick, then Castle, after reversing it in, became Castle. Then Patrick. So the reverse A list type in the list? Very blame Doc Rivers. We need not specify any era. Middle's okay, that is about rulers. There's a pools. We have ah, list of numbers number equal. Do 25 one, eight. Oops, eight, 17 and zero. So we have a list off numbers here. So what if you wanted to sort this list? You could do that with the help of a pre defined function. I told you bite and makes everything easy. So to use this function, it is very simple. We type in our list verbally. Dark sort s O D. No. We'll bring this Brende. No. So we have a number, lest it contains do. If I won a Sentinel zero will bring the unsorted list. And then we will sort this list by using the sort function or to use the sword function type in the variable name dot sort. We need not pass any perimeter in Cell sort. They will bring the list again to see the new sort of list. We'll run this and we can see that the list initially was to 51870 But after sorting, we have player descending order 01258 and seven. So the sort list, it is very simple. We can just use the sort function and fight on will sort the list automatically for us. So these are the main will bring back over. Okay, so we have bring back all of functions. So these are the most important list metals or less functions. In Piketon, they're upend, which is used to insert an element, and in this insert, which allows you to specify the location, do what you want me and said there is removed, which is used to remove an element that is the reverse, which is used to reverse the order of the element. And then there is thought, medicines to start element. So that is all about let's methods. I see the next letter. Thank you for watching and how wonderfully. 27. Dictionary: Welcome back, Everyone in this elector we're going to learn something different. We will learn another data structure. It is called the dictionary. The dictionary is very much similar. Combat would list but there is some features that make additional is very, very special. So let me start out by making Additionally to make a dictionary only had do is type in, uh, variable name. Let it the okay, sample equal. Do no in list. We use square brackets in dictionaries. Views curly brackets that is curly Moran is's no Inside the curly bracket, be the add a word dictionary elements. No. What is it? Dictionary. No dictionary in the real life contains a list of words and their meanings. Right. You'll have a set of words and their meanings. So in python, words are called keys and the meaning is called values. That means the key and the key Evil hell value. So if we type in the key, we will get the value. So to make a dictionary element First we need a key. So let the key Beaky one and lucky one store of value did you find? So this is example off a dictionary element. No the same day. We can make more dictionary elements. So what this is going to is very, very simple Key one, We'll have the value 25 key to will have the value. 35 g three will have really 45 in key for will have the value 55. Now let's stripe trending this dictionary out. We run this and making it clear output off Howard dictionary will look No. What makes dictionary standard is that they will be keep. So by using the key, we can access that unique value. Suppose you want the value stood in the one to do that. We type in our dictionary name inside square brackets. You type in key one. Now, if we run this, we get the value inside G one, which is 25. That means we can use keys to access the value stored in it. Now the values need not be indigenous. That is the best part. You can be anything. It can even be a string. It could even be a string Will try running this again. You can see that works so a dictionary will have a number of keys and each key will have a unique value. And this keys can be used to get that value. So in this case, you get the value. We used the dictionary name inside the square brackets we provided in the Kini. And according to the Kini, it will print the values toe inside that key. In this case, it will print Hey, everyone, If we change the ski 12 key to well, get the value stone key to which is 35 on we get the value 35. So this is how it dictionary works. OK, so that is all about the selective, as see in the next lecture. Thank you and have a wonderful day. 28. Modules in Python: Welcome back. Everyone know in this Lecter we will learn one of the most important features of Python that is more deals and would do. It's a very, very important, I'll tell you why. No one of your idea program. We always try to reduce the court right, so that is easy to understand for the programmer and the program works more efficiently for the user. That's great. Some would do is play a very important part in doing this. They're, too, that someone dudes, when its user defined and the other one is pre defined models and pretty find models have already defined models already made models in python. We don't have to make it and use edifying. Other models made by the use of pretty fine models are models that already exist in Python . So a very popular with you is the math Madu. Matt Muldoon contains all the important mathematical functions, almost every mathematical operation, so it is very important that you learn how to use them with you first, learn how to use a pretty fine with you. Then they learn how we can make our own would use, so that would redefine models. We cannot just directly use them with you. First. We must help. I tone that. Hey, we need to use this Madou. So to do that with the import keyword followed by the modeling. So in this case, we'll use the math Modou as an example. The math model is a pretty fine with you. I told you it condensed mathematical operations. So to use the math model, I'll show you an example. The math model has a square root function which will bring in the square root off the number. Okay, So what this program is supposed to do is that it refined the square root of 36 store that value in C. And then it will bring. See, this is what it's supposed to do. No, let's run. This I knew is a problem that square root is not defined. Why? Because there is no function called square root. No program. Yes, it is. Inside of a Mac would do. But we need to turn on the switch. Quirot function is inside of a madman you known inside of program. So to access the square root function from the magma do we must flutist use matt dot square off 36. So if we want to use a function inside a model, you must type in the modeling, use the dot operator and then type in the functioning. Simply writing the functioning will not work. No, let's try running this and you can see that it is working perfectly. We got the square root of 36 that it's six in our output screen. So this is how we use models. So I repeat again. First, we must add that more doing to our fight on file, which we do with the help of import followed by the module name, then to access a function inside a movie. Do we use the model name the daughter operator and bend the functioning and the para meter inside the function. So this is how we use some. Would you? Now we know the next lecture. I'll teach you how to make your own would use it is very exciting. I'll see you there. Thanks for watching and have a wonderful day 29. User defined modules: Okay, so we were talking about more dues. And in this lecture, we'll make our own reduce. Let us make let's make a new fight on file. We'll go to file new a bite on file, and we will name it. Add it is going to be a very, very simple program with the help of this program. Easily understand the need of models. But we made a fight on file called Ad. Now, inside this, we're writing a function called ad, which will add two numbers. That is what it's going to do, friend. A less deep, very simple function which will add the two numbers. Okay of the same way we can make more functions that will subtract, multiply and divide our numbers. Okay, cool. So we made four functions which will perform addition, subtraction, multiplication and division. Very, very cool. Okay, so this is a mini calculator, right? So we made a simple fight on file which has four functions which will perform addition, subtraction, multiplication and division. No, let's re name this file into a calculator calculator. Okay, so we have ah, fight on file, which has addition, subtraction, multiplication and division. Now, suppose you want to use these functions in another program. You could try cope, replacing this code into this program and then use it. But that will Ingres the program size. So there is a very simple that you can do this. Every fight on file can be treated as and would do so to import that model. All we had to is this type of imports and the modeling. So we had this important our model name. So this is equal Ireland to Kobe, pasting all this code inside of a new fight on file. So now we could try adding two numbers using the function. Add three. Coma four. Let's try running this. You'll see that it's not Look why? Because simply importing the model doesn't work. We must specify that the ad function is part of this Modou. So to do that, we must first type in the mood Dooling dot operator and then the functioning. Add three coma four. And now let's run this and we get the output. Seven. So we just made a mood u'll, which contains these four functions, which is supposed to be a minicab later, and then in another program, we can use all these functions just by typing in two simple lines. So this is how we make user defined more deals. So this helps in reducing the program size and also helps you in writing a very clean and simple program. So that is always the selective. I'll see you in the next Lecter. Thank you for watching and have a wonderful day.