Python 3 Programming: Your Guide to Basic Python Programming for Beginners | Matthew Dewey | Skillshare

Playback Speed

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

Python 3 Programming: Your Guide to Basic Python Programming for Beginners

teacher avatar Matthew Dewey, Writer, Writing Tutor

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

47 Lessons (3h 46m)
    • 1. Introduction to Basic Python Programming for Beginners

    • 2. Course Overview

    • 3. Programming Support

    • 4. What Is Python?

    • 5. Software Download and Installation

    • 6. Project Creation

    • 7. First Line Of Code

    • 8. Data Types and Variables

    • 9. Mathematics with Variables

    • 10. Retrieving User Input

    • 11. The If Statement

    • 12. Nested If Statements and Additional Operators

    • 13. Basic Text Methods

    • 14. Basic Math Methods

    • 15. Data Type Conversion

    • 16. The While Loop

    • 17. The For Loop

    • 18. Project 1 Discussion

    • 19. Project 1 Answer

    • 20. Introduction to Section 2

    • 21. Lists Introduction

    • 22. Lists Practical

    • 23. String Introduction

    • 24. String Practical

    • 25. Slicing and Indexing Introduction

    • 26. Slicing and Indexing Practice

    • 27. Formatting Introduction

    • 28. Formatting Practical

    • 29. Dictionaries Introduction

    • 30. Dictionaries Practical

    • 31. Tuples Introduction

    • 32. Tuples Practical

    • 33. Sets Introduction

    • 34. Sets Practical

    • 35. Methods and Functions Introduction

    • 36. Functions Practical

    • 37. Advanced Functions Practice

    • 38. Project 2 Discussion

    • 39. Project 2 Answer

    • 40. Introduction to Section 3

    • 41. Creating a Class and Attributes

    • 42. Class and Method Practice

    • 43. Inheritance and Polymorphism

    • 44. Dunder Methods

    • 45. Project 3 Discussion

    • 46. Project 3 Answer

    • 47. Conclusion to Basic Python for Beginners

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

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

Welcome to Basic Python Programming for Beginners!

My name is Matthew Dewey. I am an experienced programmer, having received several accommodations on programming in my formal education as well as taught several programming languages to thousands of students. My goal is to provide you, the budding programmer, the knowledge you need on programming in a fun and easy manner. In this course, I do just that with the Python programming language.


Python, a wonderfully simple programming language that has encouraged many programmers to pursue careers involving programming over any other language. Of course, it goes without saying that Python is an excellent language, but do you know what is required of you to start programming Python?

As with any programming language it is important you understand the fundamentals and that is exactly what I teach you in this course. From there I move to advanced studies which incorporates an understanding of special data types and processing of data, finally ending off on Object-Oriented Programming, OOP for short. OOP is one of the essential skills that every programmer worthy of employment has in their tool kit. I help you attain this knowledge and much more.

You will learn how to:

  • Install your software, Anaconda

  • Establish fundamental code

  • Create and use variables

  • Retrieve user input

  • Process simple data

  • Advanced Python Methods

  • Data Collection

  • Data Processing and Storage

  • Class creation

  • Object use

  • Attribute development and connections

  • OOP, Object Orientated Programming

  • and BONUS tips and tricks!

Go no further if you're looking for the course that will guide you into the world of programming! With my course, I can guarantee that the knowledge you learn will help you get a head-start in Python programming. I hope you enjoy the course and it helps you on your way into the world of programming!

"Programming is a form of art. It is logical creativity!"

Meet Your Teacher

Teacher Profile Image

Matthew Dewey

Writer, Writing Tutor


I have been writing and teaching for years, helping tens-of-thousands of students achieve their goals, be it completing their novel or publishing their work. Having written several novels, non-fiction books, hundreds of short stories and articles, I have studied and put into practice the best methods for writing effectively and efficiently.

In addition to writing, I am also a programmer and artist, teaching what I know on the subject and helping those interested get a headstart.

If you want to write a novel, a story that has been on your mind and not on paper for too long, my courses will not only help you start, but I will be there as well. Any work you submit, I will happily read, review. If you need professional advice or a friendly opinion, I will be there for both.See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
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. Introduction to Basic Python Programming for Beginners: Hello and welcome to your path on Master Close with Anaconda. My name is Matthew. Do we lead instructor at programming tutt dot com. I have toward path on programming for five years and studied far longer than that. In my experience, Pathan is an excellent programming language to work with. Not only that, that is one of the best beginning languages as well. If you wanna start learning passed on, this is the course for you. This first section of the masterclass is comprised of basic lectures that I help you master the fundamentals off Pathan programming. The next section of the course is the advanced and overpay studies well and more advanced methods and functions eventually moving on to object oriented programming. 00 P. Is one of the essential skills off any programmer with er p. You can create your own classes and objects, which can be re used to your advantage. If you want to excel at programming and work effectively, you will need O. B. And that concludes this introduction. In the next video, we'll be discussing programming support for this course 2. Course Overview: 3. Programming Support: hello and welcome to your basic path on course for beginners. In this video, I'm gonna be shown your heart to receive support on land. First, let me indicate that your enemy comes with a built in function that allows you to ask questions asking questions. You not only ask the student database, but you ask me is Well, I frequently looked at these, ask questions and answer many of them. So if you struggle of a particular section in the schools, feel free to leave a question for me to see and are no doubt answered. The second way you can seek support is through stack overflow. Stack overflows, a huge programming reference that that program is all of the world use to help with their coding to access stack overflow. You're simply Google. But what we're gonna do is look for stack overflow for path on. So we talked a path of stack overflow, and what appears at the very top is Stecher flow. Ask questions. As you can see, there are many users asking questions which are being answered within minutes. As you could see at the top, you can search whatever languages you need information on you can get for the info tab, or you can search a specific function such a path on input by searching this your cup of several results, which help you find out what input is in possum and hard to get it, such as user important arguments or external commands. In Pathan, usually the one you're looking for was found at the top. And in this way, Stack overflows incredibly useful when dealing with errors in Pathan as the beginning. Programming your face many errors. Which is why these are the two best options that I can offer you to help you solve them. That concludes this lesson. In the next video, we'll be talking about What is Pathom? Hello and welcome to your basic path on course for beginners in this lesson will be talking about the path on programming language. Pathan is one of the oldest programming languages to date, having first appeared in 1990. However, the most stable release for Pathan was released this year, 2018. In March, Pathan brags about advertising 5000 to 10,000 pass on jobs every month, making it a sizable career. Unlock younger programming languages such as Pass, Onal see Shop Parcel never took the world by storm but has been consistently growing. Over the years, Pathon has become part of formal education. Having been taught in many high schools, has not just universities as such as one of the top three leading programming languages. Today, Paulson is mainly used for Web development. Although applications of video games even have been created using person, the language is simple enough to start with. And not only that it has. Many uses pass on his broad, stable and powerful particle consistently grow because of this, and its population is loyal enough to design and create MAWR with its powerful language. As faras careers grow, Pathan developers have one of the highest earning salaries to date, with averages that can easily earn over $100,000 a year more. Start up companies make use of pass on than any other language. Making it the best entrepreneurial language is. So with this in mind, Password is a great way to make a splash in the programming world. From a personal point of view is a teacher. I first began learning path on in high school, having studied path on for many years, and after my school education, I can say that part on is an excellent language. To begin with incorporates a lot of the English language and less of programming jargon, making it one of the best languages you can learn as a beginner. To conclude personal always be one of the top languages because of its amazing uses, and it's huge amount of students every year that concludes this lesson. In the next video, we'll learn how to download and install the software we'll be using in this course Anaconda . 4. What Is Python?: hello and welcome to your basic path on course for beginners in this lesson will be talking about the path on programming language. Pathan is one of the oldest programming languages to date, having first appeared in 1990. However, the most stable release for person was released this year 2018. In March, Pathan brags about advertising 5000 to 10,000 pass on jobs every month, making it a sizable career Unlock younger programming languages such as Pass Onal See Shop Pass A never took the World by storm but has been consistently growing. Over the years, Pathon has become part of formal education, having been taught in many high schools as not just universities as such as one of the top three leading programming languages. Today, Palsson is mainly used for Web development. Although applications of video games even have been created, Using path on the language is simple enough to start with, and not only that it has many uses. Palsson is broad, stable and powerful. Particle consistently grow because of this, and its population is loyal enough to design and create MAWR with its powerful language. As faras careers grow, Pathan developers have one of the highest earning salaries to date, with averages that can easily earn over $100,000 a year more. Start up companies make use of pass on than any other language. Making it the best entrepreneurial language is. So with this in mind, parcel is a great way to make a splash in the program. In world from a personal point of view is a teacher I first began learning path on in her school, having studied path on for many years and after my school education, I can say that Path On is an excellent language. To begin with incorporates a lot of the English language and lace of programming jargon, making it one of the best languages you can learn as a beginner. To conclude, Person will always be one of the top languages because of its amazing uses, and it's huge amount of students every year that concludes this lesson. In the next video, we'll learn how to download and install the software we'll be using in this course, Anaconda 5. Software Download and Installation: Hello and welcome to your basic pass on course for beginners. In this video, I'm gonna be shown you how to download and install Anaconda. But you need to do next is go to the very top of your browser and enter in your euro l as follows anaconda dot com food slash downloads. Once you have done that, Chris, enter, you should see the following site the Donald and a con a distribution. Once here, you have to scroll down and choose food os. I am using windows. But if you're using Apple or Lennix, you then click on these two options. Yeah, As it stands, I'll be downloading the Windows vision. Of course, we'll be downloading the latest version and we after, of course, selector operating system top. Are you using a 32 bit or 64 bit to find out which version you're using on your computer? In case you don't know, you go to start menu Iraq, click on computer and click properties. You should be presented with this box. This will tell you the speaks of your computer, and if you go down to system top, you could see what top of Os you're using. As you can see, I'm using a 64 bit. Oh, is so close the box in down on the 64 bit version It is a sizable download. So take note of how long it will take to finish one stay installer has finished your then to double click on the Yarkon Anaconda any with the dot e x e extension. This will begin the installation. You then may receive an administration box such as this asking if you want to install this program, and I do indeed. Then click, run and wait for the set up to begin another. The set up has begin a click next. Now that the sit up has begin, we are to continue back licky next. You're then presented with the last since agreement to which you will say, I agree to continue the installation. This is where the fun details of installation come in. But it is better to follow the recommended by Anaconda, so I'll just say just me recommended Click next next year. To choose the destination for your Anaconda navigator, you need to make sure you have enough space on a computer. Seen as it is a sizable program 2.5 gigabytes. Once you have done all of this, you can click next year, then beginning more advanced options to which you check the bottom box register. Anaconda is my default path on 3.6 and ignore the top box. Seen as is not recommended by Anaconda. And as a basic course, you would be using it anyway. You're then to begin the installation by clicking install once the installation is complete , Click Next. Who skipped the V s? Kurt. Since we're not gonna be working with visual studio code, it is just sort of a partnership between Anaconda and Marcus off visual studio. But we won't be using it in this course. So Skip. And that concludes the installation to learn more about an economy can leave these checked or learn how to get started with Anaconda. But you learn about all you need in this course, so I'm gonna and check both of these in the next video. I'll give you an RD tour and learn how to create projects 6. Project Creation: hello and welcome to your basic path on programming course for beginners. In this video, I'm gonna be giving you a tour off Anaconda Navigator and the I. D. That will be using select Click on an Icon, a navigator now at the home. It will contain Jupiter Notebook and Jupiter, lad. But before click on any of thes I'm gonna first go to community and show you stack overflow , Pathan, As stated in the support video created earlier, you can go to stack overflow week and learn more about code specifically could kick of this link, which will take you directly to the path on page in the community. As you can see here, this is a quick short cut when working a programming, if you haven't booked, marked the stack overflow Sot. Once you've returned to him, click launch on Jupiter Lab, which is what we will be using for this course clicking. Launch it. Open a browser containing the Jupiter lab launcher once. Yeah, you get to choose many options that you'll be working with. We'll be working with the notebook as it is a simple interface, especially for beginner. Clicking on notebook should give you this this is gonna be our coding page. And just like that, we've greater a notebook project which will be rotting in our path on code. As you can see, it has a tab up in here into my files, which are my computer scrolling down. You'll notice our project is contained here. This is an easy way for you to navigate to where your project is being stored on your computer for her. Now, however, I'm gonna click the files tab so we just have the code to work with their many parts of the program that we're gonna be working within this basic course. First, let me show you where you can save you could save for pressing control is or clicking on the save notable contents over here. So So, just like that, you simply saved our program. However, if we don't want a program to be labeled as untitled, we can go to file save notebook as and we can name our project. For now. I'm gonna call this project the Taste project. Seen as we're just testing out our path. One for now. I'm going to label this project as our test project and click save notice, however, that this isn't a true path on file. This is a path on interface notebook, while a person file is dot p wa. While this is a people A and B to make it into a true passed on file will need to go to file export notebook as execute herbal script. Doing so will download your script into a path on file, as you can see here, P wa. However, since we were give the notebook, let me show you one more thing. Before I could clear this tour, go to your sittings and choose your Jupiter theme. As you can see about choosing dog, it is a list stock theme, allowing for better viewing, especially for you as a student. Again, this is infinitely useful as a programmer as well as you don't want to be staring at a broad screen for so long. Listen, I asked for more time on programming, which is a lot better when it comes to efficiency with programming. And do you have a project creation and the I. D E tour? And that concludes this section, and the next section will begin coding starting off with our first line of code 7. First Line Of Code: hello and welcome to your basic path on programming course for beginners. In this video, I'm gonna be showing you your first line of code. The first line of Kurt, as in any programming language when studying, is known as the Hello World Line of Code. This is because the first line is designed for a programmer to print a simple text. Hello, world. What we're gonna do is create just that was the first line of code. We go to our input bar over here, which will contain our code. And we talk in print, which will be printing our text within. Create a set of brackets and inside these brackets will have a sit off double quotations. The double quotations will contain the string. As you will see when I run it, the string we're going to run between the stubble quotations is hello world. Now we just need a run up program. It's a simple is that? But before we run up her again, you need to know there are two ways in which you can run your program. One is by clicking the play button. What you see here, as you could see, it has run our code and has printed below in the output. Hello, world. Now let's copy this line here again and show you the second way. The second way to run your code is but brave seem shift enter. You don't want to press enter alone. Otherwise it would just start in your lan as if you were gonna continue writing occurred. This is a common mistake, and most opt for just praising the play button, however, is to become more advanced to programming your safe, Tom, or using the shortcut key shift, enter. And while we here, I'm gonna be showing you two methods which you could already use to program with your string. So let's create the string once more print a set of brackets, double quotations and low world. What I'm gonna show you now is a short cut with the output. Let's pose a Harper Circle. Supposing you want to write to Lance with one section of code or sell well, you would simply copied a lot. Paste it and run it again. As you can see here, your hello world, it starts near land Hello world again. However, there's a much better sure that you can use instead of creating a second print. If you takes, this is simple. Is that so? Once more, we top in the lan and let's suppose we want world on a separate line. What were then do is topping back slash In back slashing is a short cut key that will start a new learn when printed by pressing shift Enter. You're nurtures that backslash in is not included. This is because pass on is smart enough to know that this specific character we're coupled with this backslash means that hello world needs to be printed on two separate lines. However, you will notice that there is a space included after Hello. This is because spaces are supported, the text and the short khaki does not included. But let's suppose another hypothetical. Suppose you want to leave a space between how the world large enough for someone to write in. Well, what you have been uses several spaces or a tab so printing online again we can top in several spaces or weaken tab it by using full spaces. Notice that when something stabbed, any press backspace, it deletes the entire tab. However, we just have one space for now. But suppose you want to have a tear, but you don't it up in several spaces because pressing tab as you'll notice by tapping the key, it does not work. So we make use of another shortcut, like the backslash in backslash t access teas. Again, another shortcut term that will make a tab space between hello and World, as you could see when we print the text. And that's enough for this. Listen, in this lesson alone, you have learned to write your first line of code as well as learn to short cuts when working with strings strings being text. At the moment, he seems simple. But however, these are some of the best building blocks when it comes to pass on programming and based to be kept in mind when working with daughter. That concludes this lesson In the next video, we'll learn about variables and daughter tops 8. Data Types and Variables: Hello and welcome to your basic pass on programming cause. Full beginners in this video are gonna be teaching you about variables and daughter tops Before we begin. Let's clean up our test project for the lesson. As you can see year, you have created several cells from your previous project. As you could see here, you've created several cells from your previous lesson, but I want to show you how to do is delete these cells. You can, one by one right click on each cell and delete selected sell. However, you can also start from the top or click it on the top line. Racine shift and clicking up to the line you want to delete, which is select all the cells in between and you can delete them that way, leaving you a fresh project to work with. Now that we've done that, let me tell you about the $4 tops that you'll be learning. In this lesson, the first daughter top is one you've really worked with. A string. The string daughter top is text. More specifically, it is a set of characters contained within double quotations like we saw hello World Waas in the previous listen, the second daughter top will be working with his inter jizz. It itches. Are whole numbers ranging from negative, infinite do positive infinite, such as 1234 or negative one negative to negative, three, etcetera. The third daughter top are floats, floats or numbers as well, but they include decimal points such as 3.5 or negative 6.8 and so on. And finally, the simplest but still one of the most important Donna tops, really in the brewing dollar top can contain up to three values. True, false or no? No being. If no valley is contained, however, will only be working with true and false in this course, The true and false valleys aren't of much importance to us right now, but later in the course, I'll be teaching about specific could that makes specific use of billing values. However, that is getting ahead of ourselves. And let's take a look at our first daughter. Top the string. As you know, string is a set of characters contained within double quotations. What we're going to do now is create a variable and a sonnet, a string value to create a variable. You simply top in a name. For example, it's called our variable name notice in programming that he cannot use special terms as names for variables. This is because the path occurred will then see it as execute herbal code rather as a variable name. For example. We have your name because this is a special term that we used to print text, for example, when we create a normal variable such as name equals, and let's give it a very off John A simple is that we've created a variable name, assigned a string, value their bomb, making it a string variable notice. When I run the code, nothing happens. However, if I am to top in name and run the program again, it tells me the valley contained within John. However we talk in print equals your notice print is highlighted. This is because if we were to give a value to print, it may cause trouble later and our programming so we won't be doing that for now. Just keep in mind that all variable names are lower case. If you're variable name is to contain two words or more, you will separate them often under school for example, John given to the variable name isn't truly specific. We couldn't create a variable first on the school name equals John, and we can create a similar variable with the last name. Last name equals dunks and right now program. If we were to call these variables again later on, we within just core John or blog's, depending on which one we tap. So there you have our first daughter top stored in a variable and some naming conventions to remember. The second variable will be working with its inter jizz, so let's create a simple into just such as age equals. And let's talk in a number value such as 25 and let's give it a simple value. Such was 25 shift enter. It works on the same principle as string. If we were to Toppan inch again and run a program, it would tell us the value the next. Our top works the same way. For example, we can say average as a variable name equals 89.6, and its simple is that we would call it again. We have 89.6 and I lost Daughter Top will be working with is thebe lean, taut atop. So let's create a boolean variable. Now let's call this one pass on a school mark. Notice that I don't glow a pass because that was highlighted green because it is a special term in pathum equals and I'm gonna give it the value of truth. Notice that I capitalize the first letter of True and that will be the same with false. I found one to call this again pass mark. It tells me the value as well. These are some of the simplest pro, so some of the most important daughter tops you'll be working with in Path on in Listens to come. You're ballooning some more advanced methods with these different daughter tops. For example, numbers will become very important when working with loops. Will have different text methods for our strings and wants to be working with operators with our building dribbles again. Don't stress too much what operators are. You will find out when we get there that concludes this lesson. In the next video, we'll be working with math functions with number daughter tops 9. Mathematics with Variables: Hello and welcome to your basic pass on programming course for beginners. In this video, we're gonna learn how to use math functions were floating in Tages. First, let's go to our imports cell and begin with a simple math function. Five. Plus, we run the program. It prints team. Now let's be through these basic ones first, such as five minus five that you thought about love and finally, five times. These are the simplest math functions that you'll be learning. Now let's take a look. A to more advanced math functions. There is math function. Five. Mud full. What mart or module is does is divided. The first number by the second number and whatever remains will be printed as you could see . A five divided before well, of course, equal 1.25 However, module ISS discovers how many will remain after four has been filled in five. In this case, the remainder will be one which it is. Indeed, these math functions, of course, work with variables. So let's create two variables which would contain the numbers such as numb, actually equal five no, to between 10 and then we can use those together. Them one plus Numb Care 15. And while we here with two variables, let me show you how over writing works over ratting works as follows. We can have a very but which recreates before, and we can have it equal a new value. Let's make numb one equal 15. Now when we use the same functionaries before someone best number two, it says 25 because it's 15 plus 10. This is particularly important to remember, because it could also have a variable equal. It's really plus another variable. For example, Number one equals one of us. Thank you as we saw it was 25. If we run this code and then decided to call number ones value, it prints 25. In this way, you can create very whether consistently grows as the program continues over. Our teen is very important and can be used to the program is advantage. Even though there's a misconception that's daughter. Being over written is a bad thing. We use these kind of variables than to count how many times certain could has run for specific reasons. You'll see why this is important when we begin to work with loops that concludes this lesson. In the next video, we'll learn how to retrieve user input 10. Retrieving User Input: hello and welcome to your basic path on programming course for beginners. In this video, I'm gonna be showing you how to retrieve user input. User input is invaluable information when it comes to programming. Having the user's input on certain programs makes programs much better to work of the user as well as the program itself. And in some cases, it is necessary for the program to work. While I'm going to do here and show you a simple way to retrieve user input in Pathan. First thing I'm gonna do is create a variable which is gonna contain the user input. But I'm gonna first do is ask the user to enter in the name the most common input. There's so creative variable call it name equals. And this is where I'll use the code that asks for the uses input, topping input, a set of brackets and in double or single quotation marks, you ask the user to enter in you, of course, in the dark version your message doesn't show is clearly as it should as your notice. When apparatus shift, enter our messages to dog is the background. But highlight team shows you that it is here. So it is asking us to internal name. So I'm just gonna tie. Have been John. How brace Enter, not shift. Enter. And then when I call of name again in press shift, Enter, it tells me the value. Just like that brief retrieved years. A input. Now let's suppose when we enter in a name we want to make each displayed such as. Hello, John. Well, let's great another name invariable or just use the same one. Making her name equals input. But I'll see your brackets into You'll name within created print, plant print. Hello space and how we add our name after it is with a comma. Use the very body. So let's try shift in tow. Now it's into the name and I think I'll use my real name. Enter and it says, Hello, Matthew. Now let's suppose we ask the user to enter in the age so age equals input in tow, your age when we do that to let's say we went in the age 20 path press enter which happen age to see the value and you see 20 fives encapsulated in a single quotations. That is because it is being made into a stream. So if we wanted to do any math functions with it, it would only cause errors. So we tapped in age less. Pfaff We have an era because we're working with a string, not in Georgia. As you can see here, we can only add a string to a string. Not a teacher in a later video will be learning how to convert different daughter tops into other daughter tops. For now, all we need to know is how to get used input. And we've done just that. That concludes this lesson. At the next video, we'll learn about the if statement. 11. The If Statement: hello and work into your basic parts on programming course full begins in this. Listen, we're gonna learn how to use the if statement, But before we can start working of the if statement, we're gonna first learn what operators are and how we ism operators are special characters that we use to compare certain values of other values. A quick example would be this we used a greater than symbol six, as we all know far was not greater. Six sober to run this lon, it prints false. This is an operator. Now, as you know, we can also get the five is less than six. As an operator, which is true, five is definitely less than six. Now let's take a look at any others. You, of course, can get the greater than and equal to for less than and equal to. But what about equals two while the equals do works the same way, but of two equal symbols equals April 6, you notice it Prince Falls. But if we have five equals equals five footprints. True. The reason we used to equals is because the single equals even Pathom is used to assign a value to a variable, and that doesn't work well if you try to sign six to the number five. So we used to equal symbols as an operator, so we've worked that out. But what about if something is not equals two something So we have far Exclamation point equals six. We run this line. That is true. Five is not equal to six. But if we have far exclamation point equals, it prints false because far is equal for in these ways we get a truthful or 100 value when it comes to operators. But especial about these kind of operators is we use them for if statements. So if statements are used to create sections of code that only run depending on if the operator proves true. To better explain this, let's say an operator proves true anything contained in a special set of curly brackets. After the if statement, any code will be run. If the operator proves false, the code will not run. In this way, we can create code that runs according to specific daughter, So let's create such an if statement Now let's give a variable cord numb the value of far Well, then created if statement that contains an operator, such as If space No is greater than three. Kerlan, once we have done that, were open up a set of cool brackets, which will look as follows, which will contain the code. So if numb is greater than three, languages, have a simple are put print. No print lump is greater than three, and we run our code and the message is printed. It's copy the code yet and change the very slightly. If none is greater than Tim now, as we know it isn't service operators should prove false. So let's run the code and you notice no messages printed this time because the operator proved false. That is a basic if statement. We can, of course, work this the same way with string daughter, such as name Peoples junk we created. If statement, if name equals, equals John, sit with cold brackets. Print. He is junk. We run the code. You notice it does print exactly that. However, the problem of working of strings is that it is usually case sensitive, so let's paste the code and chains. Joo Aging for Capital J to lower case Jane If we were to run the code, you'll notice no output is printed because I operated proved false. John is not equal to the lower case. John bear this in mind when accepting use a daughter that it may be useful to use one of our techs methods to generalize the daughter that well known about in another video. First, however, let's continue using if statements and move on to if else statements. First, let me give you a clean example. Using the Numb Kelly is that previews before, well paced them here. However, instead of these indented bracket severe, which are correct, I'll take away the brackets and what I'm gonna do instead is restaurant. The loan was out. The cold records. This is the old fashioned and most reliable way of creating an if statement as sometimes when using cool brackets and make it may cause areas for their own. No is greater than three. Yeah, once we're over Internet within, start next to that else, make sure the indentation is correct. You don't wanna have the elson below the print. You want to have it below the if another colon no. Then begin its own indentation on, which will print the default and we'll print a message saying No is not greater then three . And they have, if else, if we run it little Prince Nam is greater than three because it is. But if we change numbers value to, let's say, one rerun the program it does. The default, which is numb, is not greater than three because operator produce false, that else we're gonna run the code for the false. And just like that, we've created a complex if statement that has is not only its default value but code that runs. If the operator proves true, that concludes this lesson In the next video, we'll learn how to create, nested if statements and use additional operators. 12. Nested If Statements and Additional Operators: Hello and welcome to your basic pass on programming cause for beginners in this. Listen, we're gonna learn about additional operators and nice today of statements. First I'm gonna talk to you about in Eastern if statements. Mr. If statements are if statements within if statements as such, you can complete macho checks to confirm which doctor you're looking at. For example, you have been, um, equals five. You want to create an if statement that checks to see if the num is between three and six, so you're topping. If no is greater than or equal to three. Your colon, you're than top in another. If no is less than or equal to six. Another coat on and they have invested if statement so then you can print no come in space is between three and six. And, of course, you need to create to else's to fit both of them, such as else. Come on, Print no is greater than three, but greater than six as well. This will help specify your doctor supposing you looking for a number and you're not quite sure what it is? Creates a second else for the main if statement which will just print Numb is either this then three full, greater and six. And just like that, we created a complex program. And as you can see, where we run it far is between three and six, which is correct so that as a use off the nested if statement for completely multiple chicks and making sure your doctor is checked as well so that we can have a suitable output for the doctor Now let me introduce additional operators and let me show you how they can replace invested if statement saving you some code, I'm going to copy what I've written yet. But erase this nested if statement acceptable the result which I am going to keep. So let's make sure it's in the right place. Here we go. Now that we've done that, I'm gonna use an additional operator to include that sick and operator we created in the knee. Still, if statement I'm gonna talk in and no is less than and equal do six. But the end does is make sure that both operators are true to make the following could run . If one of them is false or both of them off ALS, then the code will not run, sir. If I run this program, it's his father's between three and six, which is correct. But let's suppose I changed, um to equal to three. I've done that. I'm gonna copy the same if statement, paste it and run it. 10 is either less than three or greater than six, which is correct. But you're also notice that in our else statement before using initiative statement were more specific with our message saying is greater than three but greater than six as well. What we have years unless user friendly form of if statement, however, it is a more efficient one, but that is only one of the additional operators. I'll be showing you The 2nd 1 is the old operator. So let me show you how it works. First, I'm gonna have numb equal three. I'm gonna copy if statement here and change and tool running. The program says three is between three and six, which seems right. But let's say I make numbs value. You put your 10 when I rerun the if statement, it says tennis between three and six, which we know it isn't. This is because only one of the operators is being fulfilled. That will be the nomis credit that no equal to 3 10 is definitely greater than three. However, it is not less than six, but it's still Prints are now miss between three and six. So what we've created is really a redundant form of an if statement because of the all if one operators fulfilled, then the code will run. Of course, they are different uses for these operators and nested if statements. If you were to have occurred that only runs due to specific daughter, you would use a nest in if statement or you would use end. But when the doctor really needs to fulfill one requirement, you would use an all additional operator and save you the trouble of using several nested if statements, it is better to practice the use of additional operators in Eastern if statements to campaign, so you know exactly when to use initiative statement or an additional operator. But as it stands, what we have done here by using the all additional operator is great. A useless if statement unless we change the messages, which it doesn't really matter because it'll always a fill a least one operator. What we have done is create a programme that seeks war number that's between negative, infinite and positive, infinite. And as such, the first code will always run, leaving the Els to just clutter up our programming. Be sure to keep this in mind when creating your if statements, so you can avoid clutter and create a more efficient program. However, in this, Lee said, you have learned about nested. If statements and additional operators as rollers received a good idea of when to use which that concludes this, listen. In the next video, we'll learn some basic text methods. 13. Basic Text Methods: hello and welcome to your basic path on programming course for beginners in this. Listen, we're gonna learn some text methods in its listen. We will learn three text methods are useful for chicken daughter or changing it to suit our needs. The first text method will be looking at is the length method, but the length method does is measure the length of the string and tells you how many characters are contained within. So, for example, accurate example string, such as word containing the word Hello if I wanted to see the length of wood are jumping early in a set of brackets and tub in the variables. Name all the string that I want to scan. When I run the program, it says five, Which is correct. Hello does contain five characters. H E l L o. It is a simple takes me through that we use to measure the length of the names as your notice of some past with programs that you'll find online that you need to have a specific amount of characters before Parsa can be accepted. It is this, May said, that will be used to check your password as your topping and until your internal length. That's greater than a certain number. Therefore, it is also using an if statement that we've learned earlier. We're simply creating a simple password program or for Tree of Learned, that is the first method. The second and third method are similar and are used to solve that problem we accounted with. If statements regarding strings the problem we encountered was this name equals John. But supposing it if statement wants to see if not if, the name equals lower case day O H in before it runs its code. And when we run this, if statement you notice nothing is printed. That is because although John and John or the same name, the second John and the operator is for for lower Case J. What we can do, then to make sure the doctor's uniform is by converting the name J O H N of a Capital J to the lower case, just like the rest of the letters in the operator. How we would then do this is that's copy. If statement, let's copy of the statement, paste it and change name to name dot lower and a set of brackets. This is a special method that lowers all the characters within the string to the lower case . So if we run this code, it says his name is John. What is often the case in most programming is all valleys of a string will be capital last , and they would use the upper. The upper is the second text method will be using so notice. Yeah, I use full caps. John and I would use Doctor Upper, I said. But brackets and the same result when I run the program theft enter his name is done. And just like that, we've created a working program that scans takes to make sure it is the right. Verily, compared to the one that we're looking for, these are the three minutes we'll be using in the scores, two of which methods help to uniformed daughter and another helps to create it as such, allowing us the ability to create more complex programs with such simple methods that concludes this lesson and the next video, we'll learn some advanced math methods 14. Basic Math Methods: Hello and welcome to your basic pass on programming cause full beginners in this. Listen, I'm gonna be showing you some advanced math methods. Now, Avery shown you some math functions such as multiplication division addition, subtraction, brackets. Module is and so on. Well, I'm gonna be showing you for more. Specifically, these math methods used the math object, which is stored within the path on programming code. You don't need another, but objects that much. But what you need an ally, va? That this a special Kurd that comes from program within. Pass on. Before I even show you these four advanced math methods, we need to import the math object, as I mentioned before it's happen, import mass Empress shift enter. What does that then do is import the math class, which contains all the meth objects, so you'll be able to use all these methods as follows. If you do not do this, you'll experience some errors when topping in math and will be identified in the log. Now, let me show you to math methods that we can use with floats. First, let's create a throat called speak short for special number, and I'm gonna call it far playing fast. What I'm gonna do next is use a mass may sit by topping in meth dot c e i l short for sealing inside. The brackets are top in speak. No, What this will do is Randall for the first decimal point to the highest point. So when I run the program, it runs off to six. No. Two Survivor. But it makes speak, um, equal 5.4. And I used the same method mass dot seal, speak no and run the program. It still runs it up. This isn't the mass dot run may 3rd, which rounds off. This is his method. We used to round off to the highest. If you want a round off to the lowest, will use math, that floor speak, run the program it it runs it down to five. Even if we were to make 55.9 and we used master flow, it would round it down to five. If you wanna simply Randall for number, then you would use the round method. But it does not take to advance mess methods. Rounding off the number is a simple, sane round and then topping in the value such a speak as you can see it rounds 5.4 down to five. What about to make speak numb people playing non and how to use round again? Live speaking. Um, it runs it up to six if you want to be specific of what this small place you need a rounded off to. So let's say speak. Num equals 5.12345 and we use round speaking, Um, speak none. Summer two. It'll rounded off to the second decimal place. As you can see here, 5.12 It's a simple method, and sometimes it isn't necessary, but it is a bonus to this lissome. The next to advance math methods will be looking at are the SK rt and power methods. First, the meth sq rt a shortfall square root. So if we were to top in meth, dot is cute rt visit of brackets and top in 36. So tell us the square root of 36 which is six, a very self explanatory method compared to the other ones we've done before. This one finds the square root but returns as your notice a float instead of an integer. This is because it also works with numbers that don't have the square root, such as math dot sq rt five. It tells you a square root of five in a foot. With numbers such as these thrown around the master risky. Aarti cannot be specific to numbers that only have square grids. It also works of numbers that don't have any clean square. It's kind of like 36 and the final advance math method will be looking at Is the mass stockpile method math? Don't know how. What this does is to the power off. If you have a number that you want to the power of something, you atop it in far come a to the power of to, which would be five times five and around the program it prints 25.0. This is the complete reverse of the sq R T method, and is OSA in its way? Very useful. These other four advance methods I'll be showing you in this. Listen, floor and ceiling are perfect for rounding off daughter. That doesn't have to be to specific. The Burn ISS method round, which doesn't partake to the math close, is also very is four for rounding off daughter and finally, the SK RT. And promises are severe, useful full funding in this great route for power off when it comes to mass daughter that concludes this lesson in the next video, we'll learn about daughter top converting. 15. Data Type Conversion: Hello and welcome to your basic pass on programming course for beginners in this. Listen, I'm gonna be showing your daughter top conversion before we begin. I'm gonna show you daughter top conversion between string inter jizz and floats. So before we begin, I am going to create an inter gin poured numb equals one. I'm then going to create a second number medical it if numb, which will be our float number. And it will be 5.0. And finally I'm going to create our string, which we would equals double quotations. Hello. So now we have our three variables with three different tops. The way we can check their tops is about topping in top A set of brackets and the name of the variable. As you could see, Number is an integer if numb is afloat and would is a string. What we're gonna do first is good vert an integer to afloat and string. The process is rather simple and what you're convert with can be used with other variables as well. First, let's convert an integer to afloat to convert them to afloat. We first have numb equal float said to break its no and we run the code. Now, if we're talking top, you'll see there is a float. If we ask the perfecter Turnem, it's 1.0. Now let's change numb back to one. Send them equals one. If we run the top Bergen again, you can see that it has indeed changed back to an interview. So we now know how to convert an integer to afloat. But how do we convert in? Interject to a string again? It is also very simple. Them equals. Str no, it is simple. Is that type? No. As you could see, it's a string across the program to return it. You'll see that it is one encapsulated in quotations. As you may have already guessed if we want to get it back to numb without injury in the value we could simply top in dum equals, Int said. The brackets numb and run the code, return the value. You notice it is one to see the top and you'll notice it's an indigent donna. Top conversion is that simple, and this is very useful when asking the user to anti in the age. If you plan to work the number itself. So for example, age equals input in tow. Your age. You'll notice that there will be an era if the user enters in a number, and we try to work with it because it'll be a string. As you see when I run the program, I'll maintain my age off 25 If I asked the program to print age, it prints 25 encapsulated tough H. It's a string we can then save ourselves time the same age equals and and then it's other brackets and put inter set of quotations. Enter your age, Run the program, Our Intern 25 again. But this time, when we check age, you'll see that it's an integer, a fantastic way of converting your daughter the flower, especially saving your code and town. That concludes this lesson, and the next video we'll learn about the wild loop 16. The While Loop: Bo and welcome to your basic path on programming cause for beginners in this Listen, we're gonna learn how to create and use a while. Loop A loop is used to repeat curd for certain amount of terms, as long as the operator that is coupled with it proves true. And that way it is sort of like an if statement except the loop or kitty to run until the operator proves false. We, unlike the if statement, the code within will only run once. What I'm gonna do is show you a basic while you using a count verbal. A con verbal is an interview available that will consistently add until the operator proves false. So I'm gonna create count equals zero now create the while loop. While account is less than 10 Kerlan inte and occur, little follow are simply just print count so we could see the values as they go. The next part off this, however, is we have to make sure we add to count. Otherwise, real creates an infinite loop which will cause no doubt many areas because we are unable to stop it. Of course, we can stop it in the program because we have this button every year, which interrupts the Colonel and which occurred is running through. So how do we add to its value? We simply say count equals count. Bless one. This will add 12 counts value each time the loop is run. So let's run the loop now about pristine shift Enter as you can see it, Prince Tene Valley is ranging from zero to none. So, in essence, we've created a loop that will run 10 times. So if we had 13 daughter 10 times of 10 different values, we would use this sort of wild leap to count them all. However, while it has the benefit of not only just using account, verbal, but also using any other operator, for example, we could create a while loop that will run until the user enters in stop. So, for example, let's create a string and call it name equals and we just say double quotations for now. Well, we'll do next is great. While name is not equal to stop full uppercase Kerlan in tow. Well, then ask the user to give name Really name equals input injured a name We could prints name as the are put said of your name. And with that is the upper tree have created a program. But as before, when using the text with its we need a uniform, the daughter. So we try name dot upper records to make sure when the using it isn't stop. It is the full uppercase version. So let's test out this far. It's all skin estate into the name Valentin John. Notice John is printed and we still interning values mix Lucy and so on until we enter in the full stop, I noticed that all parents stop and then I want to ask us anymore. In this way, it is a messy while, Lou, because we are printing a value that shouldn't be printed. This could easily be solved by simply copy in the land and pasting it below. So that way, toe check before it even prince. So let's re room the program again. Professing shift enter necks. Max is printed. Lucy Lucy is printed. John Jonas printed. But when a top and stop, let's make it a and let's make it a Basie stop with some upper case and lower case letters I make that works and it doesn't print. Stop burying Amanda when using this again, because now name has the value off stop. So if we try to run the program once more, you'll notice that it doesn't work because it's instantly stopped. So we need to run. This sells code one small prison shift, enter and then re running this one for placing shift into as well. Next stop and the program stops. And that is, the wild leap can be used in many ways to have a loop that will run indefinitely until certain barely reaches a certain point, whether it be checking if the user enters een a certain stop code or for number reaches a certain value that concludes this lesson, and the next video, we'll learn about the four loop. 17. The For Loop: Hello and welcome to your basic Pathan programming course for beginners in this Listen, we're gonna learn how to great and use a for loop. A full loop is a more complex form of loop. However, it is unlock the wild leap in the way that it runs using a comfortable. But how it uses account variable is unique in its own way compared to the wild. Lupas. Well, what a for loop does is create its own personal variable and then runs in range from a certain number two. Another number. In other words, you can create a very specific full loop that doesn't depend on whether an operator proves true or false, but rather more specific way in which you can say how many terms in loop will run. How you're great for loop is as follows. Four. Numb. It's all example variable in, and now we make use of a method known as range range were open up a set of brackets, and if we want to create a loop that runs 10 Tom's go from zero to 10. Once we've done that, we open our group with a colon, enter and let's say print. No, I run the code it print zero to non. In other words, we've created our loop that runs 10 Tom's. Of course, you can always fiddle off this. You can create a full loop that doesn't amuse range such as full no in and we create a set of brackets 012 five as many as you like Colonel Print? No, it prints all the valley is contained within. So as you could see, there are full values. But it makes use off the specific values we used instead of 0123 It is far building to make use off the range for your for loop. This way, you could sit how many times it runs. So working on the program we created previously in the last Listen, we're gonna be asking the user to enter end. Let's say far values to create that look for come in a range. So they re now have a loop Little run five times. So, as you can see, a for Lupus formal basic compared to that of a while loop. However, it is much more useful in the common sense. You'll be using more four loops than you will be using while loops because when it comes to chicken Datta and programming the programmer Trust to avoid checking daughter as much as possible. Rather, align are more solid, reliable numbers to keep this in mind when deciding what kind of look to use should he use a while or for lip. If it is a simple program, most likely you're gonna be using a for loop that concludes this lesson in the next video. We'll be discussing the project for this course. 18. Project 1 Discussion: Hello and welcome to your basic path on programming course for beginners. In this listen will be discussing the project for this course. For this project, you are to create a program called Age Chick. In this program, you'll be asking the user three times to enter in and name and then an age In total. They should be three names and three ages. Asan teach. After this, you must check of the ages 18 or higher. If the age is 18 or higher, you shall print the name. If not, you shall not print the name. If there are two or more names that are 18 or higher, the names should be printed one under each other. If the name is 17 Lis the new shell print and ex instead the same rule. Applause. If you have written a name that is 18 or higher and a name that isn't, you shall have the name and then beneath it an X At the end of the program, you should tell the user harmony past the age. Check for having an age of 18 or higher that should be done in a simple output. Sane the number of how many are higher and it takes ST made it into the program. Here is an example of an output. John below It is an ex below that is an ex and Vanna Lee. It ends off of text saying one made it into the program. Here some tips to help you get started first. Used a full loop to go through the three entries. Secondly, you need to check the age with an s statement. Third, you need to use a string variable to contain the airport to finally printed at the end. And fourth and finally use account very aboard to keep track of how many made it into the program. And that is the project for this course. I wish you good luck with your programming and I'll see in the next video to give you one of the ways in which you can answer this project. 19. Project 1 Answer: Hello and welcome to your basic pass on programming course for beginners in this. Listen, I'm gonna be giving you one of the ways you can answer this courses project before we begin . We, of course, have to create our project. We go to path on notebook in our launcher. We rename it to file that stated in the previous video age chick. Once we have done that, we can begin coding we're going to create the full variables that we will be working with. The first is the count variable, which will keep count of how many Africans made it into the program. Next we'll create the result. Variable what you contain. The names double quotations for now in the age label which would contain the age and finally the name variable, which will contain the names that the user enters. But those created we can now move on to the fall it before Luke Bullock as follows for numb in range than a set of brackets zero comma three. So ever loop that runs three times from day. We have name equal in foot on askin easy to enter a name. Then we have a judge equals int because we have to convert the strength to any junk. Another set of records enter and age. If that done, we create an if statement which will take the age if age is greater than or equal to 18. Colonel Result equals Result Plus Name, which will add the name and as stated in the previous video, we also need to add a new life, which is as follows before we even move onto the else we need to add one to the count so it can't equals count last one moving on to the else Now we've dealt with. If the user enters in a name that is 18 or higher, we need want for Lower result equals result plus kept ballistics backslash in to start the new Lon and that is, are fully so. Let's run the program and insert or our values shift. Enter interna names such as Next we enter in the name such as John, and it's given the age of 18. Next, it's inter names such as Lucy give her an age of 25 and our let's look below the mark and enter in Max with an age of 17. Now that we've done that. All our values have been imported into the result fable. We need to print the results. So its print result. Well, then start a new long count. And again, the message saying has made it into the program. They run this good and there we have it. John, Lucy and Eggs. John was 18. Lucy was 25 so they both made it into the program. But Max was 17. So he's name has been replaced by an ex below to ever fund upward Two has made it into the program, which is correct. John and Lucy have made it into the program, and they have one of the ways in which you can answer this causes project. If you struggled creating this project, I recommend taking a look at the on site I've written. Yeah, and seeing what difference is you can make. However, if you have succeeded and have done it in more lands, see if you can simplify a project more and finally if you succeeded and perhaps even have the same or less lines of code that I do think congratulations you have completed. This course is project. We're flying cars in the next video. I'll conclude what you have learned in this course. Uh, 20. Introduction to Section 2 : hello and welcome to your advanced path on course. First, allow me to introduce myself. I am Matthew doing lead programming instructor at programming tut dot com. I have studied several programming languages over my Korea on one of the greatest. I'll be teaching you further on in this course. This is an advanced course on path on programming. The content within will include many advanced tips. Admitted Set Pass on program is used but soon followed with complex variables, methods and functions. The content will help beginners who have been studying parts of programming for while reach the next level of their programming. Korea were not only focus on teaching these advance concepts to expand your part on programming, but you also prepare you for R P object orientated programming. Note. This course doesn't contain content on Herbie, but rather increases your programming know how to the point. You all ready for the challenge. On top of all this are provide you with a workbook which contains the information within this cause as well as quizzes. To help test your knowledge. This workbook can be used to keep up with the lessons. If you're unable to watch the videos but are hired Come in following along in the workbook to maximize your learning potential. In this course, you learn about lists, triples, Seitz dictionaries and more any north with learning some bottle programming to our be methods and functions. At the end of this course, yours to receive a project but own stress too much as I'll provide you with one of the answers that you could use. Programming involves a lot of logical creativity, so always expect a different answer from each student. In these lessons, we get practical as theoretical is saved. For the beginners. Practical work is the best way to teach programming. As one of the Founding fathers off programming, Algerian One said, programming is based talking through examples, so the could I'll be writing in this course will be done in a program that you could do as well so you could follow along and practice your programming with each lesson that concludes this introduction. In the next lesson, I'll talk about the requirements for this coast 21. Lists Introduction: hello and welcome to advanced part on course in this. Listen, I'll be introducing you to the concept of lists. A list is a form of variable that can be used to hold an array off object tops. For example, suppose any of multiple separate values that you want to be contained within one variable. You would use a list. A great example would be to create a variable to contain the daughter of a person. Let's say the first name, the last name and the age you're then created less variable and place the values within. Note that lists can be analysed and Dr retrieved using indexing and slashing index. Siemens lasting. You'll learn later in this course and practice thereafter. For now, being man that lists can be very useful. Daughter containers. For any programmer collecting large amounts of daughter that need to be divided into various sections to create a list in path on is as follows as you'll notice from the land. We start off the creation of the less variable as we would any other variable we tap in the name of the variable, follow it with an equal symbol, and then we place the values. Wen created a list. We open a set of square brackets and begin to place our values within. We separate each value with the calmer, and with that in mind, your notes are placed. Four values within this list here, huh? Being first and John being the last lists are fantastic variables to be used went processing strings of text as well as more often than not, that is exactly what they're used for. Off course, You can also use a list to contain any daughter top as long as they are separated with the comma. Here we have another example that contained with him are two values won a string and the other an integer. From this, we can see a list can hold more than one daughter Top Pass on is a truly fantastic language and has made breaking down installing values in a list easy, which in turn will make indexing and Selassie in future lessons much easier. With that said, all in this listen here, and the next video we'll practice using lists was some methods. As a bonus 22. Lists Practical: hello and welcome to advance path on course in this lesson will be taking a look at the list. Variable top the list. Variable top, as we learned in the previous video, gets created about topping in the name of the list, such as test on a school list, topping in equals of being opposite of square brackets and inserting the values that we want contained within the variable. Well, this example variable. I'll just have simple string saying Hello, comma set of another single quotations. My name It is Kama said, Single quotations, John. And just like that, we have created a list Variable, as you can see when I call the values it brings full three very is contained within this great records. What I'm gonna do now with the rest of this video is show you the several methods that you can use to work with the list Variable top. The first method comes from working with an unknown list. Very well. Supposing you want too scandalous to found out how maney values it contains, you would simply top in l E in short for length, open opposite of brackets in top in the name of your less variable. Once this card is run, as you can see, it is printed the value three because they are three. There he is contained within list. Hello, my name is John. This variable comes from working with unknown lists. For example, if you were to scan daughter and play civil values off unknown quantity inside a list variable, you would need to use the length method to find out Tonio contained. The uses are mainly derived from working with bloops. A section containing a loop is often used to go through a list. In this loop, you'll need to have an operator that is based on the length of the list, so you would use this method moving on to the sick and method. Supposing you want to add a new valley to the end of the list. What you're then news is the upended method. The A pin method is done by tapping in the name of the list, such as test on a school list dot append. Open up a set of brackets and topping and what you want? A pained. Now let's suppose I want to add the age of Joan to the end of this list are simply top of the Valley 25 instead of single rotations. 25. I'll be adding an interview 25 when I run the line of code, you know, does Nothing is supported. But when I take a look, test first values your notice. 25 has been added to the end of the list. This is the use of the upended method. Suppose any other list that is gonna constantly increase the values you're then make use of the A pin method to add to the lists values. The next method is the reverse. It is known as the pop method, which pops off the last value at the end of the list. For example, I want to remove 25 from the list. Do is simply but opinion test on a school list dot pop. Close our brackets, and when I run it it up with 25 the reason it outputs 25 is because you can play, said value inside of variable if you wish to still store it somewhere else. However, if I talk in the very ballistic again to see the values you notice, there's no longer included. It has been removed from the list and therefore imported, all stored in another variable, depending on what you write. How this would work is simple. Let's quickly add 25 again to the end of the list. And this time, when I use the pump, makes it are created variable. Could age equals taste list? Dodge up When I run the line of code you noticed nothing is output ID. But if I take a look at age the values 25 taste under school list, you know, just 25 is not added at the end of the list. This is the benefit off the pop method. It could be used to remove daughter, but at the same time, place it some whales. Supposing you wish you transferred to another part of your code? The next method we're going to look at is the sort method. The sort method is used to organize a less containing numbers or letters to an alphabetized or ascending number system. For example, I'm gonna create a list called ABC List. I'm gonna give it the values G combat. See? Come in. Okay. Now I'm gonna then use a mace it, which should organize it from a to Z or, in this case, a to C top. In the name of the list dot sort, say two brackets. I run the line of code, and now when I call the list again, you can see the list has been organized alphabetically. ABC The same would apply to numbers are create a number list containing numbers off the values three, one and two. And when I top in, um, on a school list dot sort a set of brackets and I call number lists values you notice is now being organized in the ascending number for meant 123 This method is often used in many Web services that build up email lists. Of course, the most common way you could check this top of method is in your own file explorer. For example, if you take a look in your foul explorer containing several files, you know just that they have all been alphabetized by default. This is simplified because it is using the sort method in real time. As such, if you add a file and refresh your notice that the files have been sorted accordingly. This is the benefit of the sort method to easily locate specific daughter. And finally, the last May 3rd in this listen will be looking at is the reverse method, the reverse myth that is a lot more simple than the sort method. We simply top in the name of the list, such as NUM List, which, as you know, has the values 123 within topic dot reverse. They said the brackets and run the line of code when we call the list again, you're not just varies have been reversed in the order. 321 For example, if you take a look at your file Explorer and click on Name one Small your fund that all the files have now being reversed in the off task order, starting at the lowest Beings e and then going up to the highest being lower case A. This method helps when attaining daughter that could be found a thing of a list. For that concludes this lesson, and the next video we'll take a look at string variable tops and the different methods that we can use with him 23. String Introduction: hello and welcome to advance pass on course. In this video, we'll be talking about strings. Strings are a common daughter. Top strings are ordered sequences. It is a dark top off text, many nor valleys within be their numbers or letters are text or string. Strings have been taught in basic lessons, but there are some points that need to be analysed with strings first, when we begin working with slashing and indexing is important to note, there is a number system when working with strings. Every character of the mystery, including the wild spaces, have a number value assigned to each, which will be used to Wrigley with indexing and slashing. For example, take note of the string here. It contains three words. I am John. Each character in the string has a value sound from 0 to 8. The first character I has the value of zero. The white space that follows is the Valley of one, and so on until the in. In John, which has the value of eight. Although the string has non characters in total, we start from zero, so the values go from 0 to 8 instead of one to none. The second thing to note about strings is they could be encapsulated in either single or double quotations in single quotations. You cannot begin or end your text with white space will include the single quotation character anyway, either. However, in double quotations, you can include these characters any way you wish. It is common. Enough foot program isn't passed on to you. Single quotations, however, went about taking and daughter travel. It is sometimes better to use double quotations, especially when working with user input in our practical string lists and wield. Analyze these factors and take a small peek at indexing. It's lasting. Don't worry too much if it seems complicated. At first we will do a discussion and practical listen with indexing and slashing soon after the practical lesson of strings that concludes this. Listen in the next video, with practice mastering daughter top 24. String Practical: Hello and welcome to your advance pass on course. In this video, we'll be taking a look at strings strings, as you know, on lines of text encapsulated in single or double quotation marks to create a variable for string values. A simple is topping in name equals single or double quotation marks and whatever string you'd like to store in the previous discussion before we learned that strings have another place system, which we use with indexing and slashing. The number system starts from zero and moves until the end of the string. So in the case of John, over here we have a string that starts at zero and ends at three, seen as they are four characters. 0123 However, if we encounter a string variable with an unknown number of characters, we will simply use the length method. We learned how to use the length method with lists in a previous video and the same applause we topping alien stop in the name of our variable, and it outputs how many characters are placed inside the variable. We can use this information when analyzing strings to decipher exactly where we want to start cutting or indexing are string. For example, if you want to collect the initials off names, we'd work from the beginning. However, in search of names, we might not know where the beginning is. This order pins on the doctor itself. Continuing from this what we learned in the previous video states that if a string is encapsulated a single quotation marks, we cannot include a single quotation mark inside. On top of that, we can also not start or blend a string with a white space. However, we can do all of these in double quotations. In the previous video, we also learned that if we use single quotation marks, we cannot have a string stored within a variable within single quotation mark within this text. Great example of this is you just simply top in a variable name such as text equals single Taysir marks Dio in and let's have another single quotation Mark Aziz, you can see Yeah, it's really gonna cause an era with our code. What the program does read so far is that we want to install Don. However, the tea and secret treasure mark will cause an era as the program has troubled to sir. Free what, exactly? We're trying to store, We run the program and we get an era invalid syntax, which is correct. We have a character out of place that the Kurd cannot decipher. However, we can include it if we use double condition. Works such as text equals double quotation marks. Deal in single quotation mark t you run the land occurred. There doesn't seem to be any problems at all. And if we do call it it out puts it. This is the benefit of using double quotation marks over single quotation marks. However, though it is more common to use single quotation marks, ver mind that when working with daughter that is unpredictable. It is best to use double quotation marks, as is more flexibility with what type of daughter you might receive. Supposing the doctor includes characters, which the single quotation work encapsulation cannot include. And finally, before we close this video, we're gonna be taking a quick peek at indexing. Indexing is done bust selecting a specific character from a variable. So we created previously available court name, which contains this value. Jon, which restated, runs from 0 to 30 being J three bean in what we can do is use our indexing method to take a specific character from this name. For example. Name? Yes, it was great. Brackets zero By tapping that in What is our put? It is a single character capital J the J for John. If we were to use a similar line of good but topping one it Princess the oh, the lower case. Oh, within John, this is indexing. And of course, indexing will change. When we start working in the lists, you'll find this all out in the next two videos. That concludes this. Listen. In the next video, we'll be discussing, slashing and indexing. 25. Slicing and Indexing Introduction: Hello and welcome to you Advanced Path on course In this listen, we'll be taking a look at slashing and indexing. Slash. Seen in indexing is used to retrieve characters or sets of characters from a string or list . For example, supposing you want to retreat. The character from string, such as This name equals single quotations, John. As you can see, there are four characters in the name number 0 to 3. Let's say we want to retrieve the O from John to do so. We simply topped the name of Available in this case name followed to the set of square brackets and top in the number place off. Oh, which, as you can see, is one. What this will then do is return the single character. Oh, in the output. Of course, you can even work backwards when indexing by using negative numbers, you can work from the end of the string towards the start. For example, working on the string we have created, we top in negative one to get the last character, as you could see in this example here, name square brackets, negative one outputs in. This is a fantastic way to retrieve the last later of a string without the knowledge of the length of the string. Of course, this could be continued. Tarpinian Negative to get to H negative. Three wood tree of the organ and so on. Now let us discuss Slashing. Slashing is used to retrieve a sectional string. Not just a single character. Let us take a look at the following string. Yeah, greet equals. My name is John. From the string, we can cut out specific part of string returning what is lived. This is known as Selassie. Of course, slashing the string does not replace the value of the variable. So don't worry. Your daughter will not be over written. Only the output and value returned will be adjusted. Slashing is done using the same number system. Suppose from the great string. We want to output everything from name to John. Do do so we would top the finally greet square brackets three and then a colon. But this will do is find the character of the number place of three and the cologne leads a program. Know that everything from that character to the in should be out aborted. However, there is a difference that needs to be noted when taking a specific section of characters out of a string. Here we have a lot of code greet square brackets curl on seven. What this outputs is single quotation marks my name and it concludes A You're noticed. We have the column for the number. What this does is returned everything from the start of the string to the end off name. What is important to note is that we have the value. 77 according to the system, is the place of the white space that follows name. So why is the white space not printed with the stream when working on the end of a slashed ? You should note that the second value is non inclusive. If we assume the second Valley work the same as the first and use six instead of seven, you will find the string. My name is returned instead of my name. Finally, let's take a look at the final listen off, slashing the step sauce, the step sizes, the characters chosen in the order with each class, for example, suppose I want to early print every second value in a string. What we do is adjust the steps us First, I'll create a suitable string for you to compare with, such as Numb Wadia, which I have numbered one to none, or the number place system 0 to 8. Suppose I only want to output the odd numbers in a string. What I would do. Is it just a step sauce from one, which is the default to To, as you could see, have topped in numb word sweat brackets to Coghlan's. This represents the first, really, in the second value between the Curlin's and the last failure. Overton, too. Two is adjusting the step size, which is the third value. By doing so, it outputs 1357 none. If I wanted it up, put every even number I would start from two to do so. Our top in Nam would square brackets one, which is the first value denoting way. R Slash begins. We'll leave the second value blank as before and will change. The steps are too, too, as you can see you two full 68 is out putting, and here's a funnel example for three values. Finally, if I wanted to output every even number to sit our top in numbered square, bracket one curl on 77 being the number that follows six Kerlon, too. As you could see, it outputs to full six, and they have slicing. Simple enough, but we first need to put it into practice. So that concludes this. Listen. In the next video, we'll be practice using slashing and index seen with post lists and strings. 26. Slicing and Indexing Practice: hello and welcome to Advanced Path on course. And this. Listen, we'll be taking a look at SolarCity and indexing in the previous video, We learned how to Slash and Index. Theoretically. Now let's do it. Practically. We'll start over the first example, which is a name name equals John. With that line of code written, let's begin practicing our indexing. Indexing, as you know, is done by tapping in the very real name a set of square brackets, and within it we place a number, according to the known place system, off the character we wish to return, such as one which will return. Oh, we can install this value in any variables as well as I put it, so we can create a character variable. That's good. Initial equals, name said was great brackets Sarah. What? You'll give the value off J to the initial. So if we call it again, it upwards Jane. And this way we can attain a user's initials in place that within a variable, this in itself is a very useful piece of code win attaining small characters. However, let's suppose you want to go stay, for they want to remove the last later off a string as before we discussed. We use negative one to get the lost character off any strength. This is very useful when attaining a strings last value. If you do not know the length again, this can be done such as this great A test variable equals name. Citrus, great brackets, negative one We call taste once more to see the value and it gives us in. It's simple enough to work with. Just like that, the index seen. Let's take it a step further and start working of slashing, slashing, being a more advanced form of index seen because we can attain more than a single character . Of course, we can attain a single character using slashing. However, it is quite pointless. What we're gonna do now is use lasting on a string of our own design and the next example in the workbook we had greet equals. My name is John. What we're gonna do is follow that example with slicing the top in greet a city of Squid records. Three Kerlan. The third place in the string would be in M. Bean zero, while being one a wide space being 23 being in SAR string begins at in and will end at the very end of the string because we do not include the second value, as you see when we run the code. However, if we were to create a second value, such as Three Kerlan and let's just end it at the end of name, what will be 3456 So your top in seven run a line of code and we get name extracted from the string. The reason we top seven instead of six, which is the E is because we know that the last value is non inclusive. Known that the second values non inclusive, it'll include everything just before world space. Now let's take this a step further by Justin with the third value but step value. The step value can be adjusted by adding in a second Kerlan and following with a new value . The default step value, as we know, is one one being. Each character is counted in the system. However, if we only wanted to include every second character within a string that we cutting will then adjust the steps, us well, crates and numb would variable e give it the value. 123456789 Now working of step sauce. Real lingo. Number word. Set a screen brackets Kerlan because we're not adding in the First Valley and this another Kerlan because we're not adding in a second value, and we were just the steps us to, let's say, three. This will then are put every third character until the end. So beginning first at one ending at seven a. Z, you can see these other third characters that past 1123 So that's 41237147 If we adjust the code, yeah, again and rerun it to to it'll print every second number. This case, starting with one, have moves to 13 579 Of course, we can also adjust it so it only output all of the even numbers that opinion. One. It starts at the second character, too, so to tune on, every second character will be uprooted. So from two that'll be two full 68 As you can see, when we were on the code and let's take the final step, we'll add in the second Valley so we have a three value slicing, So we are slashing with three values. Now let's suppose we really want to include everything up to for so force place is 123 so we'll use four as the second value. We run the code it prints to full, starting to move into full, and it ends just after four. So there we have advanced classing. Now let's return to lists. Let's create a simple list. Now call it a test list equals, and we will give several numbers. Is the values such as 5 10 20? Slashing isn't done of lists as often as you'd think, being that lists can contain any varied amounts of daughter, so they most likely won't be strings. So we working of numbers in this example When we run the line of code, we have now created a list of the three values. If we call this test list again to see the values, you'll see them here below. If we want to to select the values we would use indexing but opinion test list. Yes, it was great. Brackets zero Ah, put the first valley noticed. This isn't a list valley. It is an integer, an integer which we can use, So we have taste list. Zero plus five. We run a lot of code that outputs team, so the mathematics works with the Introgen. Of course, there's going to be down with one which will print 15 because we adding 5 to 10 and the same goes for the third. 20 plus five is 25 and of course the same could apply when working of strings. So let's change the value here. Let's change the first value from five to John. What were you thinking to do is tough? Yeah, test list. Zero way added in zero value. Run the line of coded outputs, John, so we can attain our strings. But at the same time, we can also slash and index them as long as we know they are strings. So in this case, we know that the first value in this list is a string called John. We can add a second set of square brackets to the end at in a value such as to we run the line of Kurt. It outputs H closes just used indexing within index seen to get the age from the string. This could, of course, work with chassis as well, when we have long strings and stored inside a list. Of course, you must be a man that this cankles problems if you try to work it with a interject. For example, I used one instead of zero, and when are rather a lot of code, it causes an era. This is why it's best to use this additional slash seen or index seen early, when you're absolutely sure that there is a string contained within that valley place. Otherwise, you will encounter this error over. Yeah, that concludes this practical lesson on slashing in indexing. In the next video, we'll take a look at formatting. 27. Formatting Introduction: hello and welcome to your advanced path on course. In this video we'll be introducing formatting formatting with strings, a special way in which we you can append an outboard string value. For example, suppose you want to, uh, put a certain amount of text, but you have a blank space that needs to be filled. What you would then do is make use off the DOT format method. How the format method works is you have the string, but where you would like to insert a string value, you would place a set of gold brackets. Once you have done this within your string, you Adam makes it to the end of said String for you, Miss. It is simply top dot format, and a set of normal brackets was in the set of nor brackets. You place your string or variable, which you want to insert. Here is an example. I have created a variable cord name and give it the value of John um are putting a string that begins. My name is, and I have a set of cold brackets before end or with a single quotation after the single quotation mark atop in dot form it. A set of normal brackets and a top in name referring to the variable are created earlier. When I run these two lines of Kurt, what is I put? It is my name is John. As you can see, we have created a variable off the string Very of John within created a place within print . To insert John, they are put is below printing. My name is John. Not my name is girl brackets. Now let's take a look at numbered formatting. Supposing you want to insert multiple values, but you want to ensure the order as well. Or perhaps you want to insert more than once of a certain value, perhaps the valleys, your teen or not. In order, you will need to number your inserts as follows. You have a simple output print one a set of cool brackets in which are based the very 13 Another set of cool brackets zero and I end off for five. Closing must seem quotation marks. My intention of this string is to print 12345 but as you could see, have to gaps in two and full. So I used the form admitted, but you'll notice in the order of the format method, I have two values. Separator a comma four goes first and to go second if I didn't number the cool brackets. What we printed is 143 too far, which is not correct. So I number them accordingly by placing the second value in the first set of girl brackets atop one and the second set of gold records. A top zero, which refers to the first value in the format set about brackets so they are put, is indeed 12345 It is a simple is that depending on the order in the format and you could place the valleys in specific parts of the string. Of course, if you're valleys I in order as they are in the string, you can leave the inside of the cold brackets empty. The benefit of using numbered formatting is that you can re use values if you wanted to. You could have had both schooled brackets contain zero and full would be printed twice. Format is all about adjusting a string with the varies at hand, and it make sure that they are methods to what you could place these valleys. Another way you can use formatting is to help define a flood value. For example, supposing you want to insert a float value, but it has too many values after the decimal point. Well, with formatting, you can solve this problem. Here's an example of how you would do this. I have here a set of cold records containing what? Your top inside your curled bracket. Very. That being the variable that you trying to insert a colon are in top in with with referring to the number of spaces between the string and the value that you're in 13 dot precision. If precision is how many places you want after the decimal point and if let's a program know you're working afloat, for example, I've created the numb variable in giving it a very 5.5555 so on. But I want to print the numb value to the third decimal place. To do this. Our top in print are then open up double quotation marks. None is another part of the state of cold brackets are are referring to, as you can see later in alarm. The format R equals numb Kerlan 11 referring to the amount of space, is that I want between numb and the rest of the string. Don't three. This should run it off to the third decimal place. If referring to that, this value is afloat. Are they close my cold brackets and one double quotations. I have the dot form it. And inside I have r equals numb. This isn't necessary. But it is common enough to do this when working with strings. So yes, I've made are equal number of closed the brackets and enough are supported. The result, which is number is 5.556 which is indeed correct. And there you have formatting with strings that concludes this. Listen, In the next video, we'll move on to practical formatting. 28. Formatting Practical: hello and welcome to your advanced path on course in this list, and we're gonna practice using formatting. In the previous video, we learned how to format. Now let's do it. Practically first, let's create a string variable for us to work with. Let's go from the first example we did in the workbook name equals John a very real way, commonly working within the schools. And we're gonna now print it using formatting, adding it onto his drink. So open are single quotation marks. My name is a set of cool brackets dot for met. Open up a set of normal brackets and we top in our variable name. We're on the line of code. It prints money. Is John a simple enough way to former someone's answer into a string? Supposing you retrieving use input such as a user's name, and you would like to use a later in the Web South service or your program. The former method is what you're used to do. Just that Knicks. Let's practice number formatting working from that example in the workbook, we go straight to print. We're gonna piss it off Segregation marks. Let's say we've placed in one cool brackets three set of coal briquettes. Five. At the end of the single quotation three. Top informant open It are set of brackets, No way. Top in the following Values were then topping two way top in full. We were on this line of good. It prints 12345 It's a simple is that? But let's go one step further. And let's say that this is out of order and we have four year and two. Yeah, when you run a lot of code, it is not an order. What we can do is use index, seem to our advantage, but happen in the place in which those valleys are ordered. For example, forwards in the zero place in twos in the one place. So we've topping one here and we top in two and we top in zero. Yeah, we ran a code. It is ordered one small 12345 Of course, going a step further is to create a many variable, which these values are contained within, For example, it's contained the a value being equal to four, and the B value being equal to to what we do then is top in the finally be and a yeah. When you run the code, you notice there's no difference. However, we can reuse these characters like we can reuse another place system, and having the characters within the format makes them easier to entertain and to remember win format in the lawn so we can have AIDS everywhere. Well, bees by creating reusable values, using the format method and thus altering strings with the former method is a breeze with these factors in mind. But supposing we want to alter more than just a string. Suppose you want to alter a foot number, which has several decimal places after it, then we would like to have in our daughter. So, for example, we have created a number, and we're gonna give it the value of one point 0.2345678 and we run up and we want to round it off to the force decimal place, which would be five. With that in mind, let's round off this float now to the force decimal place. We do this bathrooms going, print crazy in our string. In double quotation marks, the number is space. Open up a set of kill brackets were going to give this the name of in really used Kerlan 1.4 because we wanted to the forced a small place. And if so, the program knows we're working a float. Then at the end of the devil quotations, we top in dot form it have been of a state of brackets in equals. No. When we run the line of code it now, Prince, the num is 1.2346 We have rounded off to the fourth decimal place, which would be 1.2346 As you can see in the number above, year six runs up to the far, making it six. And there you have formatting how we can use it all two strings and to help the fund our throat numbers a very useful miss it for any program that concludes this. Listen, in the next video, I'll be introducing you to dictionaries 29. Dictionaries Introduction: Hello and welcome to you Advanced Path on course. In this video, we'll be introducing you to dictionaries. Dictionaries are similar to lists and that they are variables that contain multiple values . However, that is the only aspect in which dictionaries and lists are similar. Lists can be sorted, indexed and slashed because they are ordered sequences. However, you cannot do this with dictionaries. Instead, dictionaries are unknown. Ordered used to contain daughter with a programmer and user. Do not know whether values are stored. Suharto. Retrieve daughter from a dictionary. We use a key when creating a dictionary. You top the name equals and followed with the set offs. Curled brackets. When storing a value in these cool bracket, you must note that a key is necessary, a key being a lot of text. You can make these keys single characters or specific sequence of characters. It is up to you. Here's an example of a dictionary with two valleys in it. Note. The keys and valleys are separated with a car on. These are paid when separating these peers of keys and values we use a comma in this example created a dictionary good test dicked, which has two values within these two values have been sound to two keys F name and his name for if name being first name. I have a son, Joe. And for its name, I have a son drugs and the next lan I call upon s name noticed that I use square brackets when calling from a dictionary. A top in the key s name and outputs Blog's returning the value. By doing this, the dictionary is then searched and the very returned It should also be noted that dictionaries can contain many different tops our values such as lists or even other dictionaries. As with lists, you can store value within a dictionary and a very chemical using additional set off square brackets the same a prize with a dictionary within a dictionary. Yeah, I have a complex example from this example You can see that I have created a dictionary that initially contains two values. The first failure contains is a dictionary. The second value contains is an integer which is a nd not going further into the second dictionary. Your notice. I have two values again B and C, the first being and in Georgia, the second being a list in this list. Again, I have another two values path and 15 a very complex form of dictionary, but your notice in the second line, I call upon the second value within the list. I was in the dictionary within the dictionary during this first start with the outer shell of the dictionary, our select the first failure in the main dictionary. Taste it by going a. The second set of squid brackets are go See, which opens up the list and finally, the last set of brackets ago for the second Valley notice. This time I use an index, not a key, because it is a list noted extra me, and what is returned is 15. This is just one of the examples one can study when looking at dictionaries. Dictionaries are complicated when working to such a degree, but with experience, one can master as easy as any other very built up. Be sure to note that dictionaries are not ordered, meaning you're most likely used them to store large amounts of data, which will then be assigned values that could be called upon most of the term dick trees. I used to contain information on stock in online stores and the key being the product. This is just one of the examples that dictionaries are being used with online that concludes this theoretical listen. In the next video, we'll begin our practical work with dictionaries. 30. Dictionaries Practical: hello and welcome to advance to marathon calls. In this video, we're gonna practice using dictionaries. In the last videos, we learned that dictionaries are similar to lists and that they contain many values. However, unlike lists, they are not ordered, meaning it is mainly used to store large amounts of daughter that can only be recalled using a key, a key being a string which is assigned to a specific value. By calling upon this string you they call upon the value what we're gonna do know is practice using these dictionaries first, let us create a basic dictionary which holds two strings are greatest dict equals. And to open up a dictionaries, brackets use cold brackets. You top in the name of a key, which is in single quotation marks such as Okay, one which will be key one. You then type in code on any top in the value. The value that are assigned to this one will be a first name, such as Joe. And in two separate this paid value from another value. I have comma, and then I begin again by tapping into the next King Jock. Okay, too, another scar on and I'll give it a Sunni blocs running that out of code. We have not created a dictionary with two values. If you wanna call upon these values your top in the name of the dictionary, open up a set of square brackets. Let me just correct that and then insert a string key like you've done before. This time top in K one. When I run the program, it calls Joe and the same applause if I call in key number two. Okay, too rich schools, Drugs Addiction is a simple is that, But a dictionary can also contain more dictionaries like an if statement we practiced in a basic course, Willard. That s statements can contain if statements to create nested if statements What we essentially going to do now is create in nested dictionary addiction within a dictionary. So let us create addiction with an addiction now, but giving taste, victory and new value sticked sit off gold records and then I'll have a key such sk one Kerlon. Now, since we're working with a dictionary that isn't a part of taste, EQT I'm gonna give it a key which we can recognize, such as J one. Were they never colon. We can give it a value. Such airs taste waken Give it a second value let's say J two and we could give it a taste too. And finally, let's go back to our outer dictionary. The 1st 1 being tased eqt we had a comma and we had another dictionary this time with the key. Oh, okay too another colon, another dictionary. And this time I'm gonna call it. I see one cut on taste three. Come on and I give it a two Betty's as well said I would be C two taste taste for And just like that we've created two dictionaries within a dictionary and these dictionaries within contained two valleys each. So how can we call upon these values now in the next month? Well, it's practice Do that. No, we're gonna first top into sticked which we're gonna be calling and for Dalits trees the first value, but will open up this dictionary and all this dictionary We want to choose a value from within. So let's say we want to choose the first failure. The first fairly is J one. So we use the key J one in a second set of square brackets that follows. We run the good and we get test. Now let's change it and go for the sick and value within a dictionary. J two we get test to, which is correct. Now let's try key number two and change this to see what way test three, which is correct. And then we try again this dump see to get tasteful. That is how we can call the values from within. It is simple enough to call upon, and at the same time you can store these valleys and other variables. For example, we can create a temporary, variable equals taste addict, and we're gonna give it a victory such as K two. Were you called Tim? You notice it, Princess Kay twos results. So we tried temp again, and this time we want to call from K two. See to way get tasteful. Just like that, we've extracted a dictionaries from the dictionary, started within a temporary variable and then caught a valley from within. That being test for which has the key off see too. Dictionaries can be very complicated tops of variables. However, with practice, you can excel them as such. Not only can these dictionaries contain more dictionaries? They can contain lists as well lists, which can be indexed, and the values last. All the painting on you as the program that concludes this practical lesson on dictionaries . In the next video, we'll learn about two pools. 31. Tuples Introduction: hello and welcome to your advanced part on course. In this video, we're gonna be taking a look at two pools. Two pools are another form of variable, which can contain many values similar to lists in this way. But unlike lists, these values are mutable mutable, meaning they cannot be mutated. In other words, changed. The values within two pools cannot be replaced. Do Pal's can contain varies of any top, Be they string Inter Joe or so on. To create a triple is as follows. You create the names such as taste underscored to push heavier equals, open parentheses and in In this triple, I have three values separated with commerce, first valleys, a string saying hello. The next is 50 and integer and 1/3 afloat 6.78 As you can see, unlike the lists and dictionaries, a to pull makes use of parentheses instead of a curled bracket or square bracket. These various can be indexed as well, by using a set of square brackets as follows. Taste on a school trip I have here with the very of one in a state of square brackets that follows the variable name. What is output it is 50 which is correct because in the first place not the zero base but first way have the very 50 do. Polls also have their own methods, which you can use to check the daughter within count and index counters used to count harmony terms. A certain value appears in a triple index, is used to find the news value and return the place in the to pull. Here's an example of the can't miss it. I have created a very well could test tube to, which has three failures within three strings, one that contains the word one second, which contains two, and the third contains one again. I've been used the card variable dot count open up parentheses and our search fel one in single quotation marks as we know it appears twice inside the variable and the very zehr returned with the number two. And now here is an example of the index method at up and test tube to again dot index and in parentheses, I have again single quotations won and what has returned is 00 being the place in which the first instance of one appears, as you can see from my variable creation. That is indeed correct. We do have one. The value in the first place when it comes to test tube to pupils are mainly used when you start working with more advanced programs. The reason you would use a to pull instead of a list is because it is easy to replace a value analyst by accident. Then it is to try to replace a value in a triple to avoid accidentally running a program. Advance programs make use of triples An era will be thrown if a programmer trustor a place a value on a triple. Unlike the list and as Old program is no, an era was a triple is much better than an era with the entire program, and a hero with the triple can be easily solved and better coding can follow. However, if the programmer replaces a certain very within a list that shouldn't be replaced, it can cause major problems with the program itself that concludes this lesson. In the next video, we'll start up practically used with the to pull 32. Tuples Practical: hello and welcome to Advanced Path on course. In this video, we're gonna practice using the to pull. As we learned in the introduction, A triple is so on a tour list and that it contains many values. Thes varies convey very from strings to introduce to floats and so on. However, unlike lists, thes values are immutable, meaning that they cannot be replaced or changed to created. Triple is as follows. We give a name to it, such as test tube equals. Then we open up a set of parentheses. We know dext reissues, a set of killed brackets like these, and that lists used percent of square brackets. But two pills make use off simple parentheses. Within these parentheses, we create different values such as one, and we separate them from each other with comments running this land of curd, we have now created a to pull valleys. From this to pull can be called upon using the index, so to pull, so test on a school tube set of square brackets. If I type in zero, it returns one type 31 it returns to If I talk in to it returns 5.67 and That's where we are retrieving daughter from our to pull as we would a list. However, test has its own set of methods, which could be very useful. The first mate said. We'll learn how to work is the index method. For example, we give test to the top in dot index, a set of going to seize. And let's say we want to find two way around this line of Kurt. It prints one because according to the index method, in the one place, we will find the to value, which is indeed correct. Every type in test tube, I said Just grade records. One we get to. Now let's replace the values for test on a school tube. Now you may be wondering, How can we change the values if a tupelo is immutable? Well, we're not exactly changing the values. What we're doing is taking the entire to pull value and changing it. What we're doing is taking the entire to pull value and replacing it with another triple value. However, the values within cannot be changed. For example, if I wanted to change Taste Cube, I don't want the values to now be one, 23412 and are on this line of code. You noticed that they honor eras. However, if I want to change the value in it, such airs test on a school tube and I want to change the first Valley and I wanna have it equal to a string. When I run, the line of code and error is presented because we cannot modify the first value. This is the purpose of a to pull. I want to call upon taste under school, too. You see that the valleys have been indeed replaced. Now let's secular good. The second method The second method is the counter method, which is used to count how many times a certain value appears inside of to pull. For example, we know that wanted to appear to us inside this triple to check. We can go test on a school trip, doctor count, open up a set of parentheses and I want to look for how many ones appear inside test to when around the line of code it prints too. I want to see how many tours appear suddenly talking to it tells me to appears, which is correct. If you want to recount any other, such as three. It says one if it wanted to find how many fools they are, it's he's one. But let's suppose I want to find a fairly that isn't stored inside the tube, such as far when I run the line of code. It prints zero, meaning that it cannot be counted at all inside the taste triple because it does not exist within the values. These are the true important methods you'll be working with when you have two pools. While one can argue that list has more benefits than that of a test to pull the purpose of the test Tupelo is to help eradicate any future mistakes caused by that of the program, such as that of replacing a value inside a list which does not need to be replaced or should not be replaced. A to pull is made for this purpose. As such, each value add to tupelo will be permanent unless you're ready to over at the entire to pull itself. That concludes this. Listen, in the next video we'll be introducing you to since 33. Sets Introduction: hello and welcome to your advanced path. On course in this video will be introducing you to since sits of variables that are used to contain unique values. As such, sits cannot contain the same value more than once. You can have two more vintages, but you cannot have two images of the same value. Sits our basic variable tops. If you have a look at the variables we have created so far and more commonly used in stocky programs, as you don't want to add two versions of the same stock but was it may lead to an era in the program you later on. But your greatest said Variable is as follows. You top in the name equals sit open parentheses, and you include your values separated by Commons. As you can see from this example, I've created a sit with two values 50 and 55 said Variable Top has method in which a program or the user can add values to the set. To do this, you simply top in the following the name of your variable. In my case, taste undergo sit docked ad, which is the method I said to parentheses and a value which you add to the sit in this case 60. However, if you were to add 60 again or the other to introduce your values, you notice that they don't add. As explained, its head can only contain unique values, many more than one of the same top in value as explained. A set can only contain unique values, meaning not more than one of the same top in value. With this in mind, the ad method will not add the value to the sit. If the city already contains the value, there is also a fantastic used to the set variable top to go through a list and remove any dip. Lick its meaning. If you have to create a list with many duplicate values, you could then cost a list into a set, and the set will contain early, the one off the duplicates, meaning If you're to create a list with many duplicate values, you could then cast a list into a sit, and the sit will contain early. One of the duplicate values sits in this way, could be very useful to the programmer. Sits in this way can be very useful to you as a programmer he wants to avoid duplicate daughter. As all programmers know, having duplicate daughter is a future problem waiting to happen. So it is based to make use of the tools at hand to avoid it. That concludes this lesson In the next video, we'll have some practical work with states. 34. Sets Practical: Hello and welcome to you Advance path on course. In this video we're gonna practice using sits as we know sets are similar to lists and that they can contain many values. However, unlike lists, they can only contain unique values, meaning early one element of the same value. For example, any list such as taste list open up a section with square brackets, and we can include multiple values such far 67 eight and it's a five again. You're in the line of curd, the honor errors if we try to call any of the values, so let's call them or right now they're all presented. However, if we try to grade a set with the same values, you notice a slight difference. So now let's create a sit. As you know, two Greatest said to top in the name you want to give the sit, equals, sit, parentheses and run a line of code. What, with induced have been test sit Dutch ad and in another set of parentheses, you give it values such as far, and we can add six as well and do the same for all the values that we have included inside the list such a seven eight another way. At this point, let's have a look at the values that we have so far. 5678 You notice when you put the lists of values, it is contained within curled brackets, which may seem like a dictionary, but trust me, it is a sit as you notice if we try to add the same value again, taste on a school sit ad when we call the set once more your notice that this by have 678 but there's no additional five. This is the purpose of sits during continue Nique values. So if you attempted to add the same values into the set, they would not be included at all. The same goes for strings. That's great. A second sit they were gonna add to it dot and hello, When we have put it, it outputs Hello. However, if we add hello again to it, make sure the case is right. Otherwise it will be headed. It is No. The reason you have to make sure the case is rot is because if he added, in a lower case, hello, a lower case, a cello, the values would be different, and it would add to the state, as you could see when I run the code and cool is it you won't use it as common as all the other variable tops that we've created so far, however, sits are very useful to avoid duplicate daughter that concludes this practical listen. In the next video, you'll be introduced to methods and functions. 35. Methods and Functions Introduction: hello and welcome to your advanced path On course. In this video, we're gonna be talking about Miss IDs and functions methods we have used many toe alter, great and process daughter, for example. We have used most recently that admitted to add value to a set. Most missed its We do not use that often. For example, when we grade a very born decide to use and mated with it later, we could simply add dot to the end of the variable name em press tab. Doing so representative list off methods that you can experiment with and go through. However, from this list of methods is very unlikely that beyond a handful will be used in your program. The methods I have shown you so far this cost are the most used methods and opinion on your program, the most useful as well. If you want to learn what a method does in technical terms, you can use the code within path on to help you simply top help. Open up parentheses a dot be replacing a with variable and be with method and running. The line of good should present you with the short documentation on the method and what it does, of course, for more information. One. Canosa take a look at the past on documentation on land, which offers you broad examples as well. A specific ones, however, can you recommend experimentation for anyone unfamiliar with the method? Most methods are self explanatory, but some do require explanation. Now functions functions are sections of code that can be repeated at other was. These blocks can be called upon without having a top in the code. Again. Knowing how to create and use functions is a key part of Rop object orientated programming and er p is key knowledge for any effective programmer. If you wish to learn this advance, girl, almost begin with creating functions. To create a function, you simply top in death for defined the name of the function, such as function underscore name open up parentheses, which are used to hold variables that could be used in your function, even though it might not be necessary. Parentheses are must, and then in Athlon of the Koran. And then beneath this, you'll be writing the code for your function, such as in this example year I have print for indices. Double quotations had love a simple line of code that prints the string Hello. Later in your program, when you top function on the school named parentheses again and run the code your funding outputs Hello. A simple function that could be called upon again later in the program. One of the simplest examples are function can often be the most useful. However, we can add to it further. In this example here I have created a function called My name is in the parentheses. I've included a name of variable name. This is also the creation of the variable name and the code I have print open with disease double quotations. My name is plus name. What this will do is take names value and place it at the end of the string. And they said that are puts a meaningful string which can be reused later in the program. To make use of this code or you need to do is include a string between the parentheses when you rather a lot of good as in this example year. Our top in my name is appropriate disease. And I include the String Joe. Now when I run this lot of Kurt it outputs. My name is Joe, and a full string it is simple is that grating functions soon becomes the bread and butter off any programmer. But of course, creating an advance program with functions requires practice. Soon you'll be creating multiple functions at all. Work hand in hand. Many of advanced programs you'll find have more code running in the background and on the surface things because of functions. The call off bean that concludes. Introduction. Listen, in the next video, we'll practice creating functions. 36. Functions Practical: hello and welcome to advance path on course in this lesson will be practicing creating functions to create a function one simply tops and d if short for the farm. And we name my function records basic function. For now, they said the parentheses and occurred on what follows this function after a tab, space will be the Kurd contained within the function which will run when you call upon the function name. So, for example, topic print. Hello, World Rain is line of code. We have not created the function and we can call this function by tapping in the function name is year. Was it set of parentheses running the line of code outputs the string Hello world, which is the purpose of that function. And we can use it again and again creating repeatable code that'll save us Tom further on. But let's create a more advanced function such as D. If great and a set of parentheses curl on inter and in this function well, great a variable. Such his name equals input set of double quotations in tow, your own name and in the next line off, the function will be greeting the user about printing out a message saying Hello space for its plus running out of curd. We've not create to the function within topping. Greet Run the line of code and now we can, in turn our name, such as John and it outputs. Hello, John. These air some basic functions which can be created for your path on programming. And of course, they can be called upon a gin for multiple uses. Of course, most functions you'll be creating have more than one or two lines of code. Functions are designed to contain the bulk of code what your program will be reusing so you can call the function many terms as you would like saving your coat and your main program while in the background. These large functions are being re used over and over again only doesn't save your space in your code, but also creates a more efficient program that concludes this lesson. In the next video, we'll practice more with methods and functions 37. Advanced Functions Practice: hello and welcome to your advanced path On course. In this video we're gonna be practicing our functions by placing a function within a function. You know, now how to create a basic function. But how about using functions and in hand? So you need to do is write a single line of code and your main program. Well, let's take one of the basic functions we created in the previous video in the previous video recreated a function called Greet, which took the uses. Name and outputs are meaningful sentence that allowed year the user to see a message dictated to yourself through the program. What we're gonna do is break this down further by creating a basic two step function, a function within a function. It is based to have your functions clearly labelled to what they do. For example, the function that I have. Yeah, I can create two functions with a function that asks the user for the name and a function that outputs a message. Of course, creating this function by itself does save you could in the long run, but initially you'll seem like you're wasting code. However, functions can be more complex, but Let's work with more basic functions before we go that far. First, let's separate Thies to recreate a function Gord enter at in dysfunction. We have a name variable equals input in tow. Bill name at the end of this real top return name. Now that we've done this list, create a second function, this one will call greeting and in it will simply have an output print. Double quotations. Hello, plus in tow. Name another set of parentheses. Now that we've done that, we simply top in greeting great team parentheses on the line of code. It asks us to inter name, even though that isn't what the greeting function does, It does make use of the Internet function. So again I intend John, and it says, Hello, John. Just like that, we have not created two functions that work hand in hand. So let's last take this one step further. What we're gonna do is create two functions. The first function will create a list, and in this list, the user will be intern in multiple names. We then create a sick and function what's processes the list and outputs it. Each name on a different learn to do this? We simply topping def. And let's create this one is name input. Now that we have created that we now go to create a while, loop within the function which will ask the user to inter in valleys to add to a list. More specifically, we're gonna call this list. Name list equals status. Quaid Records Grill cleanup name saying it equals nothing for now. And we create Ali while name is not equal to stop full caps Kerlan And inside the while it will have a name on a score list dot append name. Beneath this, we'll have name equals input. Enter a name top stop. Full caps chained. Now that we've done that, we can end of the function bow returning name on the school list. The second function we're gonna call name on a school process Parentheses. Kerlan Inter. Beneath this, we're gonna first create a list which will contain our final list. So thin list equals name underscore import parentheses within, and they have a while. Loop, which will run through this list, are putting all the values. So we're gonna use account for able to keep track of that count. People zero where they create Olic while count he is not equal to Alien. Said to parentheses. List Curran and inside a while it will print name. We'll print on a school list, said Square brackets count and beneath friend to have count equals count plus one. And that concludes our second function. Now we simply call the second function and begin the program. It asks us to intern a name and top two in and top stop to end song, Anti and John. It's still lost a lot. Married Lucy, Joe and then full kept Stop. And as you could see, all four names are out. Put it below. John Me really See Joe. We have not create a more complex program using two functions. So just from these two functions, I've created a more complex program that can be reused again and again by simply topping in name. Underscore process parentheses. This is the core of object orientated programming. Soon you'll be creating objects that will contain many of these functions. These functions will work together. These objects will work together or creating a complex system of code which works by itself are simply topping in a simple line of code in your main program. This is the essence of effective programming that concludes this lesson. In the next video, we'll be discussing the project for this course. 38. Project 2 Discussion: Hello and welcome to your advance path On course. In this video we're gonna be discussing the requirements for this course is project. For this project, you're to create a program called Ticket Maker at the beginning of the program. You are too great. Full variables, first name, last name, age and dissed d E S t. These full variables were contained the daughter for the ticket. In this program, you should include three factions. The first function should be called Datta Retrieve and is used to collect data from the user. The doctor includes the name, the surname, age and destination to go into the variables that we've re talked about, respectively. Once you've achieved the daughter, you'll create a second function core daughter process which would convert the daughter into a surgeon for meant. The second function would turn a string containing the daughter. In this format, the format is as follows. You'll have name Colon. The initial letter off the first name point space with surname comma the age, and on the Nuland destination, Kahlan and you'll have the destination. The third function is called ticket print, which will include both of these functions by the end of the program. You should call the ticket print function by the end of the program. You should call the ticket print function, which should run through all the functions and complete the code. And you should have an output similar to the format that I've shown you that concludes this . Listen, in the next video, I'll be giving you one of the ways you can rot this program, so don't worry if you struggle. 39. Project 2 Answer: Hello and welcome to your advance path on course in this list. And I'll be giving you one of the answers to this course this project. So let us begin as you could see you. I've created my notebook and I give it the name ticket makeup. What I'm going to do now is great. The full variables and which will be placed in the values first value will be the first name. I'm not gonna give it a string. The number to create a last name of the same value an age. Say very you again and family D E S t for destination equals and again the same valiant. I don't have created these variables. I'll go onto the first function. The first functions purpose is to change the variables to global as well as give them the values against the name Dr Retrieve. We create a function d e if Dr on a school retreat, a set of parentheses and a column within make our first variable global and then we use it to and then we input into it. So first score name equals input in tow. Your first name? We do the same for the rest global Last on this morning Lost school name because in foot into your last name Global age, Age schools foot. You're age level ISS global, d E S t. And then we have g s t equals input. Such guarantees enter your destination and that is office function. We've been out to a sick and function which will process the daughter into the output we have stated before the four met that we've gonna have on our ticket. So the fund daughter process way great available at school would result equals Call it something like name plus first your name and we want the initial letter. So index it zero less that's based here. The got off to its plus lost his full name in the curl in space They were at the age they were backslash in tag will just start the new lawn destination curdle in space last DST and finally returned the result and that is our second function. We now move on to our third and final function defined ticket print to seize colon daughter on escort retreat what will run the first function And then we print out the result of the second function separate currencies. Doctor on a school process parentheses every year on that. Once we have done that, we run a program about opinion ticket print parentheses, and it asks us to enter in our first name. So it's Joe Plugs Blog's 25. Our destination is London, As you can see how put is just as we stated in the previous video named Girl on J dot blog's come 20 caf destination call on London. We have not created a useful program that could be reused again by simply topping a ticket on a school print. And we could give it anybody's we wish. John Smith, 29 New York That concludes this. Listen, I hope this answer was helpful if he struggled with this project. If you didn't struggle off this project and you've created the program with the same amount or lace lands occurred than me, the congratulations You have passed this test with flying colors in the next video, conclude to what you have learned in this course 40. Introduction to Section 3: Hello and welcome to your er p path on programming course. In this listen, you'll be learning what object orientated programming is 00 P is a practice of a programmer creating their own classes by creating one's own classes. The programmer can then create an assortment of attributes and methods that could be used to create a more flexible and effective program. As discussed, we learned how to create methods in the advanced course, but if you're somewhat familiar with the theoretical work, then you should have little trouble keeping up during the practical lessons. Thes objects are considered to be outside that off the main class in which you'll be working in. As such, it has its own variables that it makes you solve. If you want to go further with your OPI, you'll have several methods within an object working together. And then once you've created this object, you'll create another one and have thes to object to work with each other. An entire network of classes and methods of your own creation, completing tasks sufficiently with the remarkable flexibility we talked in class. We gave our class in name parentheses, Koran, similar to the way which we created method. As you can see from this example, I have two methods within the class. How we created Mr despite topping in deaf, giving in the name burnt to seize colon. As you can see from this class frame, we create a class, but opinion Kloss, writing the name in Camel case, followed of parentheses. Open with the Koran Kimmel case for those you don't know is a way in which we name things in Pathan fables and mated use lower case letters, the words being separated with under schools instead of white space. For class slash object names, we use Camel case, which is the removal of not only white space but under schools as well. The way in which we to soften the words is simple. The first letter of each word is in the upper case. Hence, the name Camel case, as it will be flat on top, will have a few bumps by the upper case letters. With that said, great in a class is simple enough, Celera's begin to create one. In a practical lesson that concludes this lesson in the next video, we'll create a class in Anaconda notebook 41. Creating a Class and Attributes: Hello and welcome Teoh P path on programming calls in this. Listen, we're gonna be practice creating a class. As you know, an object is a former variable that represents a class. For example. We can create a class as faras class, taste for us, sit off Prentice's colon and start next line. Doing so, we have not created the class in. As you can see, the next line is indented what follows in the indented lands below. This will be the inside of the class. The inside of the class will, of course, contained methods which are creates about topping. Andy. If maybe no methods in non Kimmel case such as taste under school makes it parentheses, curdle. As for what this method will be doing, I'm simply gonna make it into a print mated by Tarpinian print. Hello. In double quotations, ones I've done at a power shift enter the classes created as well as the method. Now, how does one make use of a method that's in a different class? Well, one simply needs to create a variable or object that will represent the class. So I'm uneducated. Object would object on a school interest equals a top in the name of the glass, such as taste Close said to parentheses and are on the line of code. We can confirm this creation by simply topping in type parentheses. Object under school taste. As you can see, it is part of the main costs test close. Now that we've done that, we're gonna make use of this class to create attributes within a method. Attributes are similar to what we've been using for a while now. For example, if we wanted to the length of the string read tap into at length, this is calling from a method or form of the method. What we're gonna do now is create a cross with the method, and then he's made. It will be several attributes which we can call upon later through the object. So that's created close. And is this cool this naming close current disease? Colonel, once we've created a closs, we're then gonna create a maze ID called initial. This is the initial method, which is simply creative topping in two under schools in i t two under schools, parentheses, courtroom. But you're gonna have in this initial method is the following self come in first comer last you noticed itself is highlighted, a different to the first and last. That's because first and last name of brilliant. That's because the first and last on names of variables which would contain values self refers to the method and the way we're gonna create attributes, attributes, being miniature methods that we can call upon from object. It's another trick done that we're gonna give this method some attributes dig Riverton attributes recently top itself duct. And it's cool. This one first 18 18 equals fish Really something similar this time for lost a t T. And we will give it the last fairly and run the line of code. Now that we've done that, we're gonna create an object that calls from this class. This object I'm gonna cool. Naming object equals naming close, and I'm gonna give it to values first, I'm gonna have equal to Joe. Come on, lost. I'm gonna have equal to plugs and we were on that line of good. What we've done now is created. What we've done now is created an object that represents the naming close. And with that, we have given it to attributes first a TT and lost 80. As you could see, if we top in top again, this time naming object, it belongs to the naming class. Now what we're gonna do is make use of the methods full, it accidentally naming and the school object ducked. If you press tab, you can see there, too, that we could make you soft. One is the 1st 8 ET Next is the last eight et Let's make use of the first. When you run this line of code, it outputs Joe. We could do the same Now. Naming under school Kojic ducked Lost a T T. Joe Blocks. This is the moment may seem pretty redundant, but it is a great example toe work with if you're planning to create a object that has, if you're planning to create an object that has the power to process large amounts of daughter, what you would do then is make use of these attributes to store all the values. Of course, as it stands, we've only used one example. If we were to use several, it would have more use. For now, however, we've created a close given it an initial method. We've learned how to create an attribute and make use of, said attributes. This is your very, very first step into object or intended programming and one of the most important as it lays down the foundation for Opie that concludes this lesson. In the next video, we'll be taking a look at class object attributes and methods. 42. Class and Method Practice: hello and welcome to you GOP path on programming Course in this Listen, we'll be discussing further attributes with classes First Little stick, though, that we are in the previous class that we created in the last Listen, what we're gonna do is create a initial attribute for the naming close That isn't part of a method. How we simply do is is we create a variable of value within, For example, we top in a name such as, Let's say, gender and we're going to say that Joe Blog's is permanently male. Whoever enters in with his class, when we run this line of code, it runs fun. We create our name, you know, object. It runs Justus Well, however, if we were called naming object once more and take a look at its attributes dot tab, you notice we have 1st 80 t last A, t T and gender gender when run when upward mail. This is like a global a tribute to the class naming class which could be used throughout the class in your methods. For example, if you wanted to take advantage of gender and process it, you create a global variable and use it for whatever methods that are making use the gender . Was that done? We're not going to create a message within the class for those who took my advance course. You all know that method is an action or operation that has run through an object. We've creates animated. Yeah, but it isn't sense a function rather than method. What we're gonna do is create a mason, which actually has a purpose that affects the object directly. For example, I'm gonna create a miss it and I'm going to call it name Friend. I have a Kerlan. I have a parentheses, self. I have my coat on and I'll print. And within this print, all I have self ducked first attributes plus double rotation space plus itself dot last attribute and run this line of good during that are re around this land over here just to recreate our object and we start topping and our courage to use omitted. You'll notice that when we make use off the attributes or instances such as first attribute , last attributes and gender were simply top in the name of the object dot and then the name of the attributes, what we're gonna do is slightly different to make use of a method on this case a function. So we talked in naming object 0.10 and you can see all of them. Here we have our first attributes gender last attribute, all in the instances. But we have name on the school print as a function, and we make use of it. When it comes to running a message, you're gonna have to use a parentheses if you don't use the parentheses, it'll only show you where it is stored in your computer, as you can see here. But let's make you snow of it with the parentheses and run it and Viola Joe blocks. We now have a useful method that will take the first and last name and piece them together . This can be reused with processing large amounts of data. Of course, the way that I have done it yet it is a very real way of doing it. We can do it in a much more We can do it much more cleanly with a format. So I'm gonna remove this and create a sentence. Hello. My name is Space. A set of cool brackets and I and a set of coal briquettes. Then we topping dot format open parentheses and we're gonna want the first and last name said itself. Not first. You tt less space plus self got lost 18. Come in and this will go in a second set of gold records and I literally have done that. Three top itself dot gender figured the gender We run this line of code, will you bring you run object creation and we top it in below naming on a school object dot tab And we weren't named print parentheses And there we go. Hello. My name is Joe Blog's and I am a male Very. I have amazing that northerly processes the doctor, but I puts it in a clean mannerism, as you can see here with the string Hello money, Mr Blog's and I'm a male. This is how we can base take advantage off our classes, a class that completes a certain tasks displayed with a certain part of your program. For example, a fully created program will make use of one close just for the registration off the user. The registration class will then contain many attributes and missives that the user will be making you solved with up knowing that is the purpose of the program. Of course, you want to have just one class, you'll have several. However, that concludes this. Listen. In the next video, we'll be taking a look at inheritance and polymorphism. 43. Inheritance and Polymorphism: Hello and welcome to your therapy path on programming course in this Listen, we're gonna be learning about inheritance and polymorphism. First, you should know that inheritance is a class inheriting attributes and methods of another class. In other words, it is a cost within a class, much like a nested if statement thus the name inheritance. The class that is being inherited is now known as the draft class and the new class by inheriting the previous derived plus economic use of all the methods and attributes which we created. In other words, we can save even more time not only in our initial code, but also without other classes as well. What we're gonna do to test this art is Bus simply creating a class that has a simple upward method and creates in another class that'll inherited, and then we'll make use off. Said method. What we're gonna do is create a class first class. There are bus, I said the parentheses, a curl, and we're gonna give it a method that's gonna be the initial move through. So in it I don't wanna school double underscore to open and close. We'll have a pretty disease in South parent disease who have self occurred on. And we'll create a prince statement that simply Prince arrived US output and run it just like that within creating your close and called the inheritance close currencies Kerlon create a method, an initial one just like awful in it. I'm going to school without going to school, said Apparent Disease Self cologne. And now we're gonna make use over the previous class initial method by century, topping in the name of the class in both the Apprentice. Easier. That's to arrive class and down here. But down here, we're gonna have making use but done here. We're gonna make use off the method. So that's docked on a school and a school in it, and it's going to school. And within that, we'll have self below. It are simply print in irritants, etc. But that done. All we need to do now is create an object. We can create this object by simply itself. Things like taste O B J equals inheritance because parentheses and what Just like that, it activates the initial masons off both classes. The derived class, as now being cold as you could see it is inherited the derives class initial method. We didn't create a draft cast object. We created inheritance class object. But I made fully years of the inheritance method, as you can see here and still made use of its own. But printing inheritance achieved that is the bare basics of inheritance. When it comes to working with O. P. With the understanding of inheritance covered, we're not gonna move on to polymorphism. Polymorphism is that practice of working with similar methods. Although found in different classes, Polymorphism is making use and taking advantage of this fact and we'll show you exactly others works with a quick example. Let's take, for example, that a user wants to work with male and female clients and that there is an importance between the two genders. What we're gonna do is create a program. What we're gonna do next is create a class for each gender. So we talk in class female bus set off parentheses, Karlan We're gonna give them each and initial. Miss it. I n I t on a small school said to parentheses, self and we're gonna give them a name. And we're going to simply give these clients their names stored through this method equals name, and on top of that will give them a sick and miss it. D if gender and parentheses itself Koran return itself, not name. Plus, I am space and I am a female. And that will be the class creation. What we're gonna do now is create the exact same close except called the male cross. And instead of I am a female, I am a male. Will be used instead. And we run that line of code. With that done, we're not gonna make use of two characters. The 1st 1 is Kate. We're gonna make Kate the female with the name Kate in double quotations. Numerous. They're gonna create the mail, which will be Kevin equals male boss or Indices Kevin and run. These two lines of code now is the owner. The initial methods will run, in other words, the names, and are stored within each class. And we cannot make you so. The missives, for example, Kate don't will make you so. The gender method. Kate and I am a female. The same looks for Kevin. Kevin and I am a male. We have to largely similar classes. However, you're noticed that they differ only in these two methods with same name, however, we can take advantage of the fact that they have the same name and use it to work with the different daughter. So there we have it. We using two methods from two different classes that have a similar purpose. And these two methods have the same name, even though they do fundamentally different things. High value notice If we top in top Kate Kate comes from the female cost Way is given comes through the mail cost, however, the tops off methods such as kate dot gender. Ah, strings. As you can see, kate dot Agenda is a string kevin. Gender is a string as well. In this way, we can use the top method here to help every entreat, which is the similar club, which is the similar methods. Now. What we can do is create a May said that works with both. In other words, we can create a May said only one that can go through amount can go through larger months of daughter out protein similar results, even though these methods come from two different classes. For example, if you were to call a full list of all your clients in the males and females included with these gender methods that we have. Yeah, we simply create one method and place it in a fallen. So let's do that now. But first, creating a method that works both sides D if and its quote client opportune. Is it parentheses inside of a client? Temporary variable it'll be working with. And within the method we're going to have print client print client don't gender and a set of parentheses. With that done, we've not created admitted that couldn't work through them. As you can see here, if I was to top in client, find a school return and I put in cape at Prince Kate and I am a female, I looked into fully four person in set of square brackets, Great and Kevin Colon. And within this full. If we're going to make use of the method client pretend and within the parentheses, we're going to have a person what should be taken from the folded up? Yeah, we run this line of good and it goes through the two names. Kate and I am a female. Kevin and I am in a male. So there we have it. We took advantage off to fundamentally similar methods, but different the painting on the objects. So we've not create a mated that can work through two objects, even though they have similar methods. We used it to our advantage That, in a nutshell, is polymorphism, and this is the most common way in which will be using that. However, this is something you don't have to worry too much about, as you'll only be using it later in your path on programming in Korea. So once he either employed all part of a path on programming team polymorphism can become a handy although sometimes complex, too. But be sure to remember and take advantage of it in the future that concludes this. Listen. In the next video, we'll be taking a look at special methods. 44. Dunder Methods: Oh, and welcome to your OPI path on programming course in this Listen, we're gonna be taking a look at special methods, the methods that we're going to create our perfect for classes as they help you attain certain attributes. When working with classes, for example, I'm gonna create a string here, Name equals John. It's simple string variable. And if I top in l E in Brian Disease and put name and sod, it tells me the length of how many characters are inside the string. A simple is that However, if I create a class and call it names list parentheses, I create my initial class, which is one of the special methods which we really know how to work with, dear. I'm just trying to score i n i t was going to school so self don't came a t t equals May and run this line of good. Now what we're gonna do is create a name object and give it the value of John again Names, list parentheses. John, run This line of code I call name BJ ducked, and I can call my name attribute and I'll tell me the name. However, thigh got for alien name. B J. I get an era. This is an object. Therefore it is not a string, as you can tell when you talking tough print disease name on a school O B J. As you can see, it is part of the main off names list, which is over. Yeah, but it must have topic. Top name, it would say string. We work with strings when finding the length off a string, not an object. So how do we get the length of our name? While there are two ways we can do this, one is returning back to the time we could make use of the attribute, the name on a school, a t T. And we'll get full. Of course, if you're creating a class that work specifically around a string, it might be better to have a purposeful string method to be used. A simple, up put mater that output the name and therefore a string which we can work with over a year . To create the special method, we simply top in D E if double underscore or dunder, hence the name Danta method or special methods. If you're str let's go under school self current disease itself. Come on. And within this coat on, we're gonna be returning name by creating this method were essentially giving the object the ability to be recognized as a string when it comes to certain methods. More specifically are put methods like print, whereas was before we now simply run this line of code and we top in print name B J it. Prince John. It's a simple is that Where's if we remove this line of code? Run it, recreate John and we attempt to print it again. What? It just prince is the object that is referring. But it just prince is information on what class the object is from. As you could see, it from the names is classed, which isn't what we wanted. So returning back out string, we now have the ability to print it, but we still don't know how to get the length. Well, we simply create another major that works of length, another dunder method, this time for the length, which is Elie in double into school. So cut on Britain alien name running this line of code, restoring the variable valley, restoring the object. Really, we go back to our length. We can now all remove for Sonya and running a line of code. You see it prints for it's a simple Is that creating special Done Damn it, That's all it takes is double under schools and the attributes you're pertaining to. The initial method is automatically round the moment the objects created. However, these following methods are used whenever string is pertained, such as with prince or length. When we're trying to find the length and so on, that is the importance of special methods, and it's better to take note of how to use them before we move on. I'd like to highlight special importance with these methods. They are different methods which I did talk about in my advanced course topped and void methods. Appointment since can be used to make an output can be used to change daughter, but it doesn't return anything. However top may that's do return as you can see. Yeah, these methods will return the name valley or the name length, as you can tell from return, which means I can create a string variable and give it the values that are here. For example, I'm returning name Yeah, I can then place a value within the object being the name inside another string. And they have it special, a k a. Dunder Methods that concludes this. Listen, in the next video, we'll be talking about the project for this object orientated programming course. 45. Project 3 Discussion: Oh, and welcome to your OPI path on programming course in this. Listen, I'll be discussing the project for this course. The project must make use off two classes one class that retrieves and processes daughter and the second that inherits that class and outputs the process. Dr. A. K a. The information. The purpose of these classes is to, uh, put a finished document on the client. The first class will be used to retrieve and process the following doctor The first name the last name, age and home city. This class should be called process daughter. The initial method collects the doctor and the second method will process and return the finish string awful daughter. You can call this myth it as you wish, but the finished daughter should look as follows. I have four valleys here. John Blog's 25 London. The result. Daughter should look as follows Name Colon space J. The initial of the first name dot space, the last name blog's that it will start a new lan age Colon 25 and another New Line City Colon London. The second method should be able to take the starter and process it as follows returning it in one string. You'll then create a second clause which should be called our region. Adi g e n What you want to hear it? The process Daughter class. Make use of the methods and print the result. Your entire project should be named after the main class which in this case is our Dejan. So your project should be called adi generator. So to recap, you're creating a project called Hardy Generator with two classes. One class which will retrieve and process daughter daughter being the name last name, age and home city and a second class which will output the daughter your then create an object pertaining to the second costs. And once you have created it, the initial method, what should print out the daughter should run. So by simply creating object you have printed, you're finished information that concludes this discussion in the next video. I'll be giving you my answer to this project 46. Project 3 Answer: Hello and welcome to your er P pass on programming calls in this. Listen, I'll be providing you with an answer to this course is project. As you can see, I've created a notebook project called Idee Generator, and I'm now going to create the two classes which will make up the call of our program. First class, as you know, is called process Data. Currency is called on within this glass. I'll have two methods. The initial method which will collect the doctor and the second method, which I'm gonna call process daughter as well, which will process the doctor into a string. First, let's create the initial method. The if double under school in it, double on the school said to parentheses itself. We have It's correct That self first name I was called first. The last name Last age, real age and city for the home city. Next, our creator local attribute first a t T. Which would contain the first name. And I do this with all the others as well. Last 18 equals last t t equals age again. It's correct that so ducked city in the school 18 equals city and there is the first method . We know we're going to the next method, which is gonna be the process started me prices daughter again self, and we begin. Now I'm gonna put this all into one return string instead of creating and variable adding to it as I go state, I'll just have return Name Kerlan Space itself not first on a school a t t. And then I have set a script record zero because we want the initial of the first name, plus the palpitations dot space itself that last 80 plus the reputations with any stubble quotations. I'll have backslash skin. What will be a tag? Landed starts in Ulan age cut on space, less self gut age. Katie Thus set of double quotations back sesh in sitting girl on space Less self got sitting on a school a t t a simple is that we have now comprises the daughter by putting it into one single string. Now we have our final results that needs to be output it and run through another class which we're gonna create Now The second class, as you know, is gonna be called class body gin and we want to do inherit the previous class proceed starter. So we top that in cut on. And in the initial method, I have no one is going in it. Double under school Set of briquettes Self come. There s name l name aged Sienna School place cut. These will be the place fairly is for the four Berries which we're gonna be entering into the program. So process don't Nirvana school lying on 80? Because we want to run the initial part of process daughter, which is this method of year self? Come on. If on a school name Well, I'm just coming aged, See, on a school place that should be all the doctor needs Now we can move on to simply printing out the finished result which I have in one line print Croesus daughter dot Priceless on a score daughter On May 3rd, we created itself from this land and then we have two classes created. All that you need to do now is adding our daughter into an object and the initials should be running, meaning it will run the initial May 3rd full Adi Jim then therefore also run the instrument Little process, doctor. And then in the print. It'll run process started method in the process daughter class. So we simply just need to create the object. So I'm gonna call it test O b. J equals I Qi Jin set of parentheses an hour just entering our values. I said That will be jump Space Blog's 25. Any comes from London from this line of code and viola in our ports of final result Just as described in the previous listen as the name J blocks age 25 city London Just like that, we've created a working program based on classes We have made use off objects, as you can see here and taken a huge dip into the world of object orientated programming. Of course, one can be even more complex of the Rop of having more classes and more objects or working hand in hand. However, that concludes this. Listen, if you struggle, then I recommend taking a look over the lessons in the schools one more time before tackling the project once more. However, if you passed or created even better program than mine, they congratulations. You have completed this course with flying colors in the next video are conclude to what you have learned in this course 47. Conclusion to Basic Python for Beginners: Hello and congratulations on completing your ropey path on programming course. Object orientated programming is a valuable skill, as it is not earlier complex understanding of path on, but because it lends the programmer ability to create programs that are much better than anything that could be created without, um, if you want to develop in an amazing program that involves so much changing daughter, you'll need Opie. From the beginning of this course, you had an understanding of methods and some advanced concepts with Pathan programming. But as with most, you needed to attain the knowledge of object orientated programming well, by completing the project for this course, you have done just that. He learned how to great classes. He learned how to create dunder methods and use inheritance and polymorphism to your advantage. The very cause off object oriented programming I need to do is to take things further, and to do that, you need to create programs of larger networks, off classes and objects all simple enough to do but harder to keep track of. However, that too, could be candle with practice or proper connection. Tracking object orientated programming is just one of the many tools that you'll be using in your path on Korea. Having completed this course, you have taken huge steps into creating more object orientated programmes, therefore, helping you develop the skills necessary to complete larger programs and be a more fictive programmer. Congratulations and competiveness 00 p course and good luck with your further studies.