Python Programming: Learn basics of Python | Mohammed Khan | Skillshare

Python Programming: Learn basics of Python

Mohammed Khan, Full Stack developer

Python Programming: Learn basics of Python

Mohammed Khan, Full Stack developer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
8 Lessons (1h 22m)
    • 1. Introduction to the Class

    • 2. Introduction to Python

    • 3. What are Variables?

    • 4. What is Type Casting?

    • 5. How to Access a Character?

    • 6. String Slicing

    • 7. Inputs in Python

    • 8. Area of the Circle App

  • --
  • 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

Hello and welcome,

In this class, we will be learning about the Programming language 'Python' and make a project by the end of the class

I'll be providing all the project files in the class resources so that you can use that and continue to build your own Awesome Project

we will be learning everything about Python Programming language right from the basics.

we will be making a simple Area of the Circle calculator where we will be learning how to implement the All the things that we have learned.

list of the things taught in this class:

  • Variables in python

  • Type casting 

  • How to access a single character
  • String slicing techniques 

  • Inputs in python

This is a very nice and small class you can learn a lot of things by completing this course.

Meet Your Teacher

Teacher Profile Image

Mohammed Khan

Full Stack developer


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.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

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 the Class: Hello and welcome. My name is moma time and I'm full-stack developer niobium instructor for this course. In this class, we will learn everything about Python programming language right from the basics. And we will learn what are the advantages of using it. And I've been learning all of these things about biotin and advantages of bed. We will learn how to install biotin and we will learn how to create our very first program and Biden. And then we will also learn things like variables in Biden, typecasting. How do access characters using the strings? Strings slicing techniques and puts in Python. And after learning all of these things, visually making our project, which is nothing but the area of a circle project. It is the area of the circle calculator. So here we can enter the units and we can enter the value of pi. You have, you can enter the value of radius. And again, we'll get the value of the area of the circle. We will basically be able to calculate the area of the circle with the input that they use a valley curve. And in order to complete this project, where we'll learn how to use input method and Biden. And we will learn how to work with arthritic operators. It will calculate the area of the circle. And we will learn how to type, cast, and output all of the values using the print method. And after completing all of these things, and after learning all of these things, will be able to create this awesome project that you are seeing over year. So, yeah. And after completing this project, you will be able to put this project on your resume CV, RCV, or perhaps share this project on Skillshare with your friends and family. And what are you waiting for guys, join now and start learning how to corn and biotin to see you all guys in the ghosts. 2. Introduction to Python: Hello and welcome. So in this video we will look into the introduction of Python programming language. So what is Python? Python is an interpreted object-oriented programming language. So it is a high-level built-in data structures combined with dynamic typing and dynamic binding and make it very attractive for rapid application development as well as it is used for as a scripting or a glue language to connect the existing components together. Biden as simple. It is easy to learn and it has easy to learn syntax, which emphasizes the readability and therefore reduces the cost for program maintenance. Python supports various modules and packages which I'm graders the program, program modularity and code reuse the Python interpreter. And so Python uses are interpreted and the Python interpreter and the extensive standard library are available in source or binary form without charges for all major program platforms and can be freely distributed. That means it has open-source, everyone can download it and everyone can use it. So I'm sure you did not understand all of these things that I've seen. Worry about it, we will understand everything and you'll be able to write a single line of code or at least a single line of work by the end of this class again. So let's move forward. So now let us see what is it used for? So let's see what is your, what is it used for? Well, it is used for web development and it is used for software development that are like many frameworks like Django and flask that is made from biting. So both of them are used to create websites. So many websites like Facebook, Instagram, Twitter use django. So that is not 10. So once you learn by 10, you'll be able to create websites as well. Okay? Of course there are other languages that you must know, but you'll know how to use, how to create websites if you know how to work with biting. And the second one is software development. That means you can create any SS office webs, web applications. And third one is the field of mathematics. You can solve mathematical problems by importing many modules like num by simple, right? So there are like inbuilt modules inside Python that help you to solve mathematically complex mathematical problems like integrations, derivations, and all of that stuff. So in degradation and derivations are some things related to mathematics, and it also helps us to write machine learning and AI goods. So biotin, of course, mathematics is AI is related to mathematics side so that the way we use Python for AI and machine learning. And the third one is systems corrupting. Well, systems scripting is like we can communicate with the operating system or something like that. So that is what it is used for. So now that we saw, but it is used for. Now let us see. Why should we use Python and what can it do? So Python works on different platforms, like Windows, mac, Linux, Raspberry Pi, etc. That means it is, we are able to run the Biden program in any operating system as far as I know, like Windows, Macs, Linux, Raspberry Pi, and all of that stuff. And Python is simple syntax similar to the English language. That means personally, Python is very much easy to learn because the syntax, the way of writing the code is very, very much simple. You do not have to memorize anything. It is just like reading English language. So Biden has syntax that allows developers to write programs with fewer lines than some other programming languages. So there's a program called Hello World program. When you write that program in using Java or any other language, you might have to write five or six lines when, when we use BY then we began complete that only in one single line of code. So I didn't. Python helps us to do that. And Biden runs on an Android beta system. It's not necessary for you to know what is an interpreter, but meaning that God can be executed as soon as it is written. This means that prototyping, prototyping can be very quick. And last point is by then can be treated in a procedural way and object oriented way or a functional way. Python is Object Oriented Programming, programming, program, programming language and procedural programming language and a part of function programming language. You can use it any way that you want. So what can it do? Of course, I've said that by 10 can be used on a server to create web applications. By them can be used alongside software to create workflows by tin can connect to database systems. Of course, the website development and all of that stuff. It can also read and modify files. So we can work with file systems and are using Python. Item can be used to handle big data and perform complex mathematics, as I've told you before in the previous slide, python can be used for rapid prototyping art for production, that is software development. So enough knowing about Python. Now what we will do, we will move forward and get started with the coding so that we will not waste any of our time and start with the coding side. Okay, so now what I will do and move forward and I'll show you what are the things that you are supposed to install enough for in order for you to code in Python. So let's move forward. So very first thing that you have to do is to go to and search for Biden down or the spreads this thing. And as far as you, as soon as you write this thing Tuesday, very first option that is already a download button. And this window will basically pop up and audio after do is to press this Download button, Python 3.94. This is the latest version, aspart, the state that is 4 9 2021. And and as far as I know, it will automatically recognize your operating system minus windows. As you all can see, this is Windows. So Windows will automatically recognize that my operating system is Windows and it will show me the download link for the windows. So there are like different, I'll show you, there are like different versions of Python. This is the version of 3.9.4. Which I think is in stable. This is biden 3 and Python do. Most of them will be same, but there are few things that are different. So that unlike see, this is the a virgin Alpha version that is being tested. That means that there may be some bugs in your in the pipe. So the stable area as far as I know is begin basically use the three-point nine version. This is, this one is a stable element that is available on the by hyphen download. So you can just press Download. I have already downloaded it. You just have to press Download and press Next, Next, Next. Okay. And now after downloading it, you can open this thing. It'll basically open up over here. And again night any line of code. So there is one line, there is one program called HelloWorld program. Don't worry about distinct and show you everything but not. So as to make sure that this line, this thing, Brent, and inside those double quotes and inside this right, jumping over a year and present over here that says show HelloWorld out of inspite, enter successful in starting up. This thing, disclosed this one. And now after doing this thing, we will need a place where we can code. Of course, we cannot write the code in that black window, right? Because we need some citations. Again, don't worry about it. I will show you everything. So now our Director Lew will go to again. Just make sure that our Northern African longer downloading and come back over here and write VS Code. Download. Okay? But as this thing, it will basically open up this thing, Visual Studio code. Let's open the fast link over here. And it will basically show the version that DO monotone style. So minus window sizes, press this one as soon as I pass this one. So the downloadable basically start and it will basically give you the instructions on how to install it. You just have to open this file and press Next, Next Next, I'm not going to install it because I already have Visual Studio code inside. As soon as Zoom Standard you will have this line. So just open this up. Okay? And, and remember all of the chords that we are writing in this course or in this class will be on my GitHub profile. Okay, so you can just go there from my skill shares link, from my profile link on the Skillshare. And just go over there. Okay, let me just click, delete everything over here. And we will press File and breast new window. What's wrong? Yeah, alright, W. So I'll just close the previous one. Okay, so here we can press, we can write new file over here. So let me press Open Folder. And I will go to this PC and I will go to data. You can just go anywhere that you want and press New Folder. And I will call this new format as by 10. One horse class. Okay. So I will open this up. I'll press Enter. Oh yeah, I will select folder. So our formula will be opened over here. So as soon as you press this button, this button over here, you can see that we are in this toilet, okay, so now we can do some of this stuff away. As soon as I best thing, we can press, we can create a new folder inside the folder that we are currently yard. So we are inside the pipe 10 van class for that that we have created in there, d, dr. And we can also create a file. So now in this video, we will see how to create a Python file and run our very first program. Okay, So let's get started. So now press this file button, new file and Bride, first dot p-y. So every Python file, as soon as he, as soon as you write C, first dot p by as soon as you write dp VIII will have this pythons in Malawi him. So he visually Studio Code is telling us that this is a Python. Just ignore all of these things. Python file that you want to create, okay? So every Python file will be with the extension of dot p-y. So I'm sure you have seen for DO files that are like dot JPEG. Similarly, this is a Python file that is dot py file again. And let me press enter over here. This way you can create the Python file. And so now you will have a new lab. You might have. You might have a pop-up over here dulling that Python interpreter Nazi just ignored all of these things and please go over here and press this button over here. And it will ordinary deck, but you can, if, if it doesn't auto detect over here, press a button and it'll have this one, make sure that they're despite Hannover. Yeah. Okay. And if you press this one, extensions and you're going to search for Python, you can install the packages that that means it will basically, it is already installed in my Visual Studio Code, but if you want to, this one, you can just install this again. And now, the easy part, now we will be writing our very first program. I'll write p, r, i n d. And press the sun and write hello world. Okay, I'll press Save, I'll press Control S to save our program. And what I will do over here and press right leg. And I'll go here and run by 10 file and terminal. So Perez discipline. So as soon as you press this thing, it will basically run your program in this way, and this will be the output for your program. Okay, So congratulations on making this, making our very first program C, It has very simple what we are doing over here is that we are printing something inside the console. So print statement, this is called as a print statement. Okay? So if you wanted to print anything, we have to write the double-quotes and then we have to write anything that is over. Yeah. Okay. So I'll write my name is Muhammad son. Okay. And press this one and you just have to close the brackets. So whatever is inside this W goods are quotations, quotation marks. This is known as double-quotes. Now again, this symbol, this symbol is known as double-quotes. That is beside the shifts in with inter symbol. Okay? So now after that, whatever you write over here will be printed inside your right leg and press Run fight by filing an answer, it will say, My name is Muhammad. Hi. So now as a challenge, I want you to remember, memorize this one and remove it off. And now as a challenge of this video, I want you to press, Print, and write your name inside that double goods. Well, I guess you have done that. It was very much simple and easy. Let's write print, right? Hello, my name is known. All right, okay. Whereas Control S to save it, see if you do not press Control S. I'm sure that a lot of newbies make this mistake over here. What they will lower the herd, they will ride this thing and they'll press right leg and Ride. Press Python file in terminal. So nothing will happen over here. It ran because if I just press right leg and by ten file and dominant, so it does automatically saving it off. That's a good thing, but as soon as you make some changes, it will have this byte data with you. Okay, just make sure to remove that by pressing Control and S on windows and Command S on Mac. Okay, So that means the current state is being saved. And press right-click or you can press this Play button asthma and display. But I know, yeah. Hello, my name is smooth. And over here you can just press CLS to clear off everything. So there's a concern. Yeah. So now if I press play, we'll say, Hello, my name is movement fan adulation for completing this first program of your life. If you're learning Python for the very first time. And in the next video we will look at variables we will look at is how to use mathematics in Python. So see you all guys over there until then, goodbye and take care. 3. What are Variables?: Hello and welcome. So now in this video we will look what are Biden variables, the lettering, create a new file by pressing this thing. And after this and just press, I'll just create a new file called variable start BY. So we'll speak more variables. Variables are basically containers for storing data. Values are storing some value. Well, I guess you have learned what are variables in your high school if you if you have mind to a high school. Yeah. So you might have come across a problem like Find the value of x. So this, I can just telling a problem that was in my elementary mathematics. So it was something like find the value of x. So this x is gone as a variable. So we can store some value to it, like we can assign 15 divide and we can later on use this value somewhere else. So this is what variables are. So variables are basically containers that store some values. So let's see how to create a variable, val creating a variable as very, very simple in Python, you do not have to declare anything, just have to directly assign the value to the variable that you want to create. Suppose, if I just want to create a variable called name like x, let us suppose I wanted to create a variable called x and I just have to assign a value to it. I just have to write equal to symbol and press 15. So this is the syntax for it. And what do I mean by syntax? Syntax basically means it backs basically means a structure of the state wins in a computer language. I mean, this is the basic structure of a, of creating a variable and assigning a value to it. So before, in the previous video, if you saw, we wrote this thing. So this is the syntax for creating a print statement. So we have to write print. We have to basically write these two things. And after that inside this one. And we have to write double-quotes and write anything inside. So this is the syntax for writing up by a print statement, and this is the syntax for creating a variable. So this is what variables are. So later on, if I want to use this variable and suppose if I just want to create a variable, another variable called y, and if I just write or D into it, okay, if I write 14 to it. And then over here, if I just wanted to add both of them by basic mathematics summation, adhesion. So I can do so by writing. And of course I'll store that value inside some other variable. So I can do so by writing like sum is equals to. Again, over here you can write anything or add, or you're going to add anything. Oh yeah. Suppose if I write ASTM, that's completely fine. And I'll tell you the rules for creating the variable. There are some, some rules for assigning a variable I'm creating the name of the variable, will speak about that in a moment. But for now, let's add both of these x and y together and I'll create, I'll put this thing in. Add, media, add VAR, and variable. You can name anything that you want. You can even name this thing ACEF. That's okay. But for the sake of understanding what is this variable, we will name this thing a nominal. What it does. So we are naming it does add variable, add variables. Okay, so now what we have to do, yeah, you have guessed it died right? X over here and I plus symbol earlier and vice symbol. Yeah, oh yeah. So this will basically add. Now get this, it'll basically add x and y and store it inside, add to it. So as you can see, it says, It shows or you call it invalid syntax. So it is telling that invalid syntax, let's see what is the error. So let me press Control S. And as soon as I save it that it is gone, that means this variable is automatically created as soon as I add vote of these values. So I do not have to declare it, but in some conditions you have to declare it, which you will see in the future. We just don't worry about it. So now run this application. Let's run this application and let's see, let's display button. Okay, so I'm just going to press this Play button. And as soon as I press this Play button, as you can see over here, it does not do anything. Of course, as you can see, it does not do anything because we're not printing anything. We are just adding the values. We're not doing any kind of action over here. So now what I will do over here, I will print this variable that we have got so and write add var. So in order to print a variable, so normally we were writing something inside a earlier. So in order to print a variable, we have to write this syntax, we have to write print. And like similarly like nominee that we do and write f over here. And inside this thing, we have to write to flower brackets. And inside this flower brackets we have to pass the variable, that is this one. So whatever lawyer I would write something like the adhesion of x and y variable is equal to add that. And now I'll read, press, play over here. So it says the addition of X and Y variable is 29. That's really cool right now if I change this value, c, that's 40. Okay? So these are the variables. So similarly, now this variable is having a number. Suppose if I want do like 1D variable to store a name or something like that has letters and letters and symbols and letters, symbols and numbers. Okay? So how can I do that? So I can do that similarly that we are doing over here. So what we are doing over here is that Android name and An equal to, and I will add double-quotes just like we are writing over here. And now I will write saf. Sof crime is my other name. It's my nickname. So my name is normal and now mine. So I'll add more metanoia, and this is my name. And now, if I wanted to print this name, now as a challenge, I want you to print the snip. Again, this follow the stinger in this copy distinct over here, but I want you to do it. I suppose you have done that it was journey map symbol. You just have to write parent. Our year and we have to write this double-quotes Android f of area. So as Phil help us add this thin layer, a very move this thing and play. This will show an ad. Okay, So what I will write over here is that my name is mainly okay, So now let's press play. So my name is Mohamed, handle, addition of X and Y variable is 40, and my name is Muhammad. So that's like really good. And now let's move forward and let's see. What are the data divertor, the data that we can store them inside the variables are then unlike many types of data that we can store, well, but normally we have three types of data. One is the integers, these are known as indeces. Invaders are basically whole numbers like 15, 25, and we have strings. So these are known, these are known as strings. Remember, we can also store 123456 over here. And remember, we cannot do this thing like we are doing over here. We cannot write FOR area. I don't know if you can do that. As far as I know. We cannot do distinct. Okay. We cannot do this thing or video since we are assigning this thing. Let's try it out. Let's see if it works or not. Well, yeah, we can do that. That's really nice. Again, do that. So so this is the thing that we can do it here. Let me remove this one and let's skip it to polonium. So as you can see, we can also pass in numbers over here. The strings can contain numbers, things can contain letters, shrink and condense, combination of letters and numbers. Everything is possible in the scenario of a strict, okay, So these are strings. Strings are always inside the double quotes. Remember about that? That's a very important point to remember. Repeat with me, strings are always inside the double quotes. Okay, so this is everything about strings. And the next data type that I want to show you over here is the floating point fractional values of floating point data type. So what are fractional values? Well, if you've googled what a fraction values, fraction values are nothing but that has points to it. So let us suppose if I wanted to create a variable called a, and if I just want to store it, if I just wanted to store my height in a variable called height and tell that I am 11, um, 1.2.3 meters. So we have this point value, right? So as soon as I hover it over here, it says phyllo dough again because it is a floating point variable. So is offloading variable. Okay, So as soon as you hover it over here, it says this is an integer. Okay? As soon as you hover it over here. I don't know. Yeah, it says SDR. Sdr is the short form for string, okay? So similarly you can find out be distinct. And now this thing we're signaling gives us the floating point value. Okay, This is a very important thing. So these are the main 33 of the important variables. So again, so that's it for this video. And by now, I just want to give you a challenge away. Very easy challenge. I'm sure you can do this thing. What I want you to do over here, let me just remove everything. Okay, I'll tell you about a concept called comments over here. Just highlight everything over here by pressing Control a and press Control. And friends slash that is on my keyboard that is beside the right shift button. Press that. As soon as you press that, it all turns to green. Over here, it says green, green, green. What does this hash symbol? If I remove this thing, it's showing it's becoming white. So this hash symbol is known as comments. Comments are like if I just want to, if I'm working with some other guy, of course, if you are working in a company as a Python developer, you will have to work with so many people. So if I want to add something over here, so if I'm working today and if I just forgot to add a function and the shredder comment line over here, like I have to add camera functionality. Okay, I can do this thing after I had a fan of, and I'll just close that when a list come back again. And I'll see that I have to add up for extending our camera, for example, when I distinct. So these are useful comments. Okay, so I'll just save it. Oh yeah. So I'm just commenting everything art and phi government, everything out and run distinct C. So we have now put over here, let me just write CLS or yeah. So never fear of everything. Let me press right-click and press Play. Oh, yeah. Yeah. So it says it chosen, it doesn't show anything because it is commented and Python waving all of the comments so good. So now I want you to do, I'll just show you, do you know the formula of how to find out the area of a circle? The formula for finding the area of a circle is Pi r-squared. So the value of pi is 3.14. So what I want you to do and yet the first step is to create a variable I and store 3.14 to it, okay? And next step is to create another variable called radius and store any radius like 2, 3, 4, 5, anything that you want. And now I want you to compute like pi r-squared. So I want you to do what I want you to do it here. I want you to multiply by and multiply radius and multiply radius again, so that really by r-squared pi into r, into r and stored into a variable stood the area of the circle in the variable, in a variable, in the variable called area. Okay? Do this. Well, I suppose you have done that. It was very, very simple. Ali After do is to just try bio here pi is equal to 3.14. I've shown you how to create a floating point variable right over here again. And next step is to create radius and showed an irradiance. So I lied radius is equals to five, okay? And write Pi over here. And what I will do over here and find out the area I write equals 2. And I'm going to buy multiplied by, multiplied by simple as the start symbol. You might be thinking you might have pressed this thing, X symbol. So that's not eggs, That's not multiplication. That's, it's okay if you're not, if you're not able to find out the multiplication symbol, that's completely fine. And I pi radius. So there is good thing about Biden has died. What we can do over here, in order to write power, we can write two multiplication symbols and distinct. This will basically consider it as R-squared. I guess we might have to put this thing inside the variables. And now this is the, if this is confusing for you, this is equal to 0. Let me show you. This is equal to buy them radius and radius. Okay? So now Vardy or low, any other printed this area. Okay, Let's Spend the cilia. So the area is 78.5. So now what I want you to do, I want to print the ADN, this sphere. So what I want you to do a year, if the radius of the circle is the radius that you have created. And then I want you to write the radius of the circle is our radius and the area of the circle is area. Okay? So go ahead and do that now. And I suppose you have done that. It was very much simple. We have to add FOR area. Remember to write f. So the radius areas of the circle S, really s. Oops, is equal to radius and the area of the particle S area. Okay, and let's press, Okay, and let's close this thing. And as you can see over here, this is the program for finding the area of a circle. Okay? I guess we do not have to write this symbol over here. Learned very awarded. Let's save that I have, but I said that shouldn't be a problem. Let's press right leg is equal to, yeah. I press right-click and press Run Python file and dominant. So, so why do we have to know where he had his dad? As you can see, I've just pressed Enter because it's going, it's going right up the screen, so that is there is enough. But as this thing, so Martin began over here, we can add this thing. And we can also add when this thing over here. And I guess that should fix the problem. If not, I guess we have to write the symbol so I'll just check it real quick. So yeah, so let me just quickly do that. So yeah, let me just write three symbol to the three single God sodium if there are like multiple lines again. And now let's press Play. So as you can see that areas of this Erica less five and the area of the circle is 78.5. So now if I change the radius to seven. So this will help you a lot in your map problem. If the radius of the circle is seven, the area is 153. Okay, So that said guys, that said for this video and this video, you have learned more variables. What are different types of variables? What are strings, and how to write a mighty lines print statement by using Drupal lines of this thing and how you learned how to multiply. So that's on, are all the things that you have learned or gap. So that's it for this video, guys see you all guys in the next video to learn goodbye and day care. 4. What is Type Casting?: Hello and welcome. So in this video, we will be learning about casting. So we will be learning something going Biden casting. So let me create a new folder and you create a new folder as well and call this thing as casting. Not BY, you can name anything that you want. So already here, there may be times when you want to specify a type onto a variable. This can be done with casting. Item is an object oriented programming language. And as such, it uses classes and speak about classes and the different class to define data types including its primitive types. So what do we do over here? We can basically the Biden that this video is should be a floating point variable. So we can do so by writing x is equals to. Suppose if I wanted to create a variable called x, and if I write end over here and inside the end after pass the brackets and inside this thing after pass any baby. So if I pass my window and I press, of course this is a variable. If I pass in floating point variable like 12.5. So this is basically round up to 12. And now let's print this x over here. And let's see. So it says two alphas are designing. Our bird is removing this, this thing over here. So this will be a flood. That floor will basically, as soon as you however end it says it is a class. So that is what I was telling to convert a number or a string to an integer. So it basically converts more developers and inside the well in deja. So we can also pass a string as well over here. If I pass in a string and light spilling, so it sees, it doesn't, it doesn't matter it with data. If I know this thing and if I press Play, it will basically convert it into indeed. So it basically does this thing. And it is very much symbol, No, no such rocket science Senate, we are basically converting an integer to a string. Similarly, what we can do, we can convert it into a float as if I just strike Florida area and press Play. There it is, converting it to a float. And similarly, we can also convert it into a string by writing STR, I guess, yeah, by writing STI. So if I write anything over here like this thing, and if I just print that. So this will be a string over here. So this will basically be a string. So if our ID over here, this will be a string now. So this is what casting us. And remember you cannot invert and later into us in detail or a flirt. Suppose if I have Sappho a year and if I want to convert into an end, that's not possible. Because what we know SFO leader is F a whole number. No, right there it will say that invalid literal far in deja web-based them, so it doesn't possible. So that way, what we are doing over here is that we are and where they getting into US. India. This way only if this is, this has this thing. So this is what typecasting us. So now I know there's a challenge or You know what I want you to do. I want you to create a variable like 12, like age and height. Age and height. First I want to do to create a variable R, as age and story are alienated and create a variable called as height in centimeters, stormwater them and sign it and hide. To unmute variable and add both of them together. Advert of course, add both of assign an ei and ej and hide to a new variable. Oops. Add what's wrong, lawyer. Well and age and height to a new variable. And can avoid that. They are motherboard of them should be invidious. And what both of them to float. I mean, the summation of the Asian height should be a floating-point video. But I suppose you have done that. It was very simple. I've created a variable called age and 18 and I as 172. And after that, after that, age as ADM and high dies when 72 and I will write sum is equals to H plus hide. And what I will load the she'll be in deja. So what's wrong? As I said, we're an integer and print over here. And I will write some. Oh yeah. But there's basically this would basically putting the baby of some. So as you can see, this thing is what do you call it as an integer, right? So now what I will do over here is that I will basically sum it up and write Florida area. So the silicon basically convert it into a float. So now as you can see, this is a floating point variable. So this was everything about typecasting. So that's it for this video. Guys see you all guys in the next video till then, goodbye and daycare. 5. How to Access a Character?: Hello and welcome. In this video we'll speak about strings a little bit more. So strings are like at is water and is arrays are set of elements that are of same datatype arranged in a sequential order. So we'll speak about that in a moment. But for now let's create a new folder called strings dot p-y. Okay? And over here I'll be assigning a string called name as equals to new. Assign your own name. I'm going to assign my own name. Sephora, I know. Yeah. Right. Oh, yeah. I'll just press Save. And then after that, what if I wanted to gain access to the first element of my name? So I can do so by writing this line of code. Let me just quickly add a print statement. But instead moment and over here, name, this name will basically print the whole thing. Foil name said fine. And now if I wanted the first element, I have to write the square brackets and I have to pass in the index, the index of the element that I want to access. Suppose C, in every programming language like Python or Java or any other programming language, every element will start from the 0 at index 0, index the first element will be 0. So I can write 0 here. And now if I just press play, so there we go. We have the S. Okay, so now what if I wanted to gain access to the a, then that would be this. If this is 0, if S is 0, then a will be one, right? Let me quickly write my novel. Yeah. Okay, so let's press play. And there we have 10 year and again fibrous back. And if I press two over here, this will be i. Now as a challenge, I want you to pound and access the edge element inside the string. So I suppose you have done that, knows very simple. What I will do a year like always, whenever I want to access any kind of element, or I will start with 0, 1, 2, 3. Or remember, space also counts again, 5, 6. So I guess that's six. So let's try out price six hour. Okay, there we go. As soon as I write six that again, and that will give me the access to h. Okay, so now what I want you to do, now the challenge, I want you to create a variable that we remove everything over here. I wanted to create a variable like first name and last name two variables and assign your name, String, firstName and lastName, do it. And in the end, I want you to ride. The first letters of a firstName and lastName is the first letter of your name. And the first letter of your last name. Just write bad thing. So if, for example, the input would be safe and firstName and lastName. So now it should, output should be industry. My first letters of size to name. First letter of first name is is it caldo? S and as an and my first two letters of my last name is it. Ok. And similarly, you can do this thing in the sphere. Let me just close this one. Close this one has been to make some space and let me just increase the size of the courtyard R, the Arctic and see properly. And this shouldn't be the input and this shouldn't be there. But go ahead and do that as a challenge right now. Well, I suppose you have done diagnose very much symbol. All we after doors to just write files to a year and assign Lee said, What's wrong? I'm sorry. Yeah. Assigned Sappho. Yeah. And and ride. I wouldn't find them the first name and last name as it goes through. And now I'll write a print statement. Okay? And I will use three these things. Yeah, I'll get confused over here. 1, 2, 3, wine. You agree with that? I'll have multi-line statement and I will pass in F, liberal lawyer. And I will write the first letter of my first name is equal to 0, highlighted in the past name, square bracket 0. Ok. And now I'll press N bar and I will write the first letter of my last name is yeah, you have gas, they're dried. Z. So let's try it out. Let's press Save. And that's vastly. So for some reason it's giving me an error in that first line itself. So by mistakenly change the nothing was wrong. So yeah, as you can see, the first letter of my firstName and lastName, first layer of our last MSK. So yeah, bad was it. And now I'll speak about the rules of creating a variable. Remember, you cannot start with a one. You cannot start with a number. You should always start with the body on it, the letter R with a symbol. So that's possible as soon as I write number, it's stunning to read. If that's the color. So yeah, that is one ruler does over here. And remember if I write firstName and if I write first name, these two are different. Okay? So it's case sensitive. This is what it's case sensitive. That means this variable is different now and this way, well, it's different. Again. Notice by what I wanted her pen over here. Now. And I said, guys, that's it for this video and the next video, I'll be teaching you how to modify the strings and how to access the last letter of the string. Okay, so see you all there. 6. String Slicing: Welcome back guys. So now in this video we'll be working with the same file. So now I want you to change this thing. Last, last, OK. And now we're here inside of this, fine. So there is a method. Let me show you over here real quick. Let me just quickly comment this out. And over here there is an inbuilt method in Python garden and that will calculate the length of anything like that recalculates the eyes you can see return, return the number of items in a container. So if the string firstName, as it goes to Sam, so of course it has four values in it, right? 1, 2, 3, 4. So this Len of firstName couldn't give me for it. Let's try it out. So as you can see it give me four, similarly, again, access to the last element. But since this is starting from one vine 2, 3, 4, but if you are, if you remember in the previous video, I said that every, in every programming language the first element will start from 0, then emit. So this is 0, 1, 2, 3. So that is lent minus1 value. So what I will lower here, Len minus one. So that will give me the last element of the mistake. Similarly what I will lower, yeah, I'll use the same concept. And I will uncomment this out. And instead of writing 0, we're here. I will write Len, len of firstName minus one. Okay? I can do that. So that will give me the last element of the string Len of last name minus 1. Let's first flay. So the last letter of a firstname with F and last letter off my last name is. And so now what I will load this code is getting quite dirty. Yo-yo. That means no one can understand what is it, what is their turnover here? So what are low? And yeah, I'll create one more variable by last, last f, that will last firstName, and I will add FirstName, lastname, firstname minus one. Okay? I can do that, but Eigen also only gain access to the last elements number. So this is that one and last L is equals to len off lastName minus 1. This will give me the three and this will also give me 3. So instead of passing 0, I will write the last. Last f, okay? And right, last. And I guess I will have the output, the same output over here because nothing's changed. Okay? So these are all the things. And now I'll show you a concept called string slicing. Okay? So let's see that. So slicing me basically means you can return a range of characters. So every single element is known as a character inside a string. So you can return a range of characters by using the slice syntax. Specify the start index and end index, separated by a colon inside the square brackets. So we'll speak about that in a moment. And then I'm just going to comment this out and we'll come over here. So what I will do early on, I would write full name for learners go and name as equals to mom. And okay, smartphone name. And over here, I will use the concept of string slicing and oil. And I'll only access gain access to the firstName of my name. Okay, So let's see how we can do that. So remember, can you calculate orgasm tenants? Can you calculate what is the index from 0? From 0? So that's like, let me quickly add a comment line or area. Or the Arduino IDE 0, 0, 1, 2, 3, 4, 5, 6, 7, 8. So that's like 12345678. Yeah. So it's still seven over here and this is space as nine. And okay. But I'm not no idea. So what I want to access already added 0 to seven. I can do so by writing brand name square brackets. Remember when Racket is very much compulsory and already had I will pass in the first element is 0. And the last element where I wanted to gain access. So see this thing over here. If I write seven or here, I write seven. So remember seven does this element. So let's see what's happening. As soon as I write seven. So it's not gaining access to the last, the seventh element. So that's like more mud moment. Okay, we have, we should have this DO YOU so far that we have to pass in a ladder ahead of the letter that you're going to access. So if I want to access the B element, the character, then I, I'll have to put EDO area. So that will basically start from 0 up to eight. That will start from 0 and up to eight. So it will not, That's the aid. It relied 0, 1, 2, 3, 4. So this is the lower limit and this is the upper limit emanated or not, that's the lower limit. And this will give me the first name. So now what I want to do, what I want you to do is that right fast as equals 2 and write the firstname OEM. Similarly. Similarly, like we are writing this thing over here. I want you to do that and I want you to do but in the first and the last name. So I suppose you have done night was very, very simple. You just have to gain access to this man and this one. And now I have to write full name and now I have to calculate from. So that's like nine, 10, 11, 12, 9. I'm right. Nine gun because I wanted to have and everything that is after nine. If I write nine colon, Let's see what's happening. Okay? Let's press last. For here. My last name is equal to last over a year and that's first flee and last name as time. So by writing this line of code, it will basically move until the end of the string. This is a string, right? We are starting from here, so we do not need to calculate anything. I'm Amy and until the end of the string. So it'll basically automatically computer itself. So similarly, if I write this thing and stopped in here five, so it will start from the beginning and stopped. So that's like the sun, and that's like 0, 1, 2, 3, 4. And okay. This is the output that you are seeing. Oh yeah. We have one more concept up negative indexing as well. So as you can see over here, we are starting from 0, 123, right? Mode. If I want to access the, let me show you. What if I write something like minus Van Eyck, 0 to minus four is, you know, 123 minus five. Okay, let's see what is the output. So it says muhammad, 0 to minus five will basically give us more money. So that will not make any difference. But now I'd have a low here. I'll show you in a moment. Now as again to you, and here we have minus minus. So what does minus basically show? So similarly, we were like riding bind neutral, right? So the last element would be minus one and the minus two. And there should be minus three and minus board. Yeah, minus three and this will be my as void. Similarly, so on and so forth. So now if I want to access the last element, and this way, if I want to access the final idea, I'll have to write minus 4 and I guess minus 4 two. I'll just leave it over here. Let's see orders the output side, again, access to this one, okay? It will go from minus 4 to be whatever n-minus-1. See what is the output? Yeah, it wasn't moved on this map. So yeah. So, yeah. Now, after learning this concept, I want you to do. Complete a challenge. So before completing that challenge, I will be basically giving a nice, I'm like an S in over year. So you'll be able to complete the time. So again, so now there is one concept. Okay, So now what if I wanted to write my name in the reverse order? So I can do so by writing brand name and write the square brackets over here. And inside the square brackets I will write colon, colon minus one. But they'll be going in the negative orders. So if I write one more go in and, and, and if I write minus 1 over here, so it will basically move in this way in the reverse order that you start from here and minus one, minus one minus 200. And he had, let me write two over here. Let me do it here and let's see what is the output. So it is only hopping two times M H M E space hedge. And this is the output. Okay? So now if I write three over here, so the output will be hedge EM space a. Yeah, let's see, are disjoint but m, a, okay, So m is the thing that it will basically, and an M and a e k. And again, so now similarly if I write for and press Save M, 1, 2, 3, 4 m and wine 2D space and, and, um, okay, um, EM space. And so similarly, the last number is the number of hops that you want to do. So similarly, if I write minus 1 over here. So if I evaluate, let's see what happens if I write one. That, that will give me basically give me like one M OH, everything and then basically loop through everything. Okay? So now if I, as we know the concept of negative indexing, so this is the concept called negative indexing. We'll start from the last letter and I minus one. Let's see what is the output. So it is basically giving me the c and a edge k and h k be okay. It'll be MM, to their home. By home. Yeah. That's really funny. Again. So now what I want you to do, I want you to complete a program that and it's basically asked in an interview, I guess, in an interview for a junior developer. So I want you to check if the string is a palindrome or not. If the string is a palindrome or not. Okay. So what is a palindrome? Palindrome as a letter that when the reversed will be the same. So an example, madame is abandoned because if you start from the reverse order, if we write MAD am, so that will be mad at him as well. And one more example is mom. So mom is abandoned Rome as well because if you reverse it off, it will him mom. Okay. So this is called as a palindrome. Yeah. So let me remove this one. And now what I want you to do here is to complete that palindrome program. And the input will be NP-hard as equals to, again, write input as equals 2. Madam, I wanted to do. But I know that it is a palindrome. I mean, by writing the printed value as Marilyn and Marilyn, the reverse order. Because you know, right? Let's take a DVT our brain and back. If this is a palindrome, but if it is apparent and then print the value. Okay, so go ahead and do that. Another challenge. Yeah, Ali, After do this, try and paint and F. Oh yeah, and right over here, the normal, the input is equals to n bar is abandoned Rome. Because when reversed, it has the same meaning. Okay, let's see what is the art bird? Okay? We just basically pressed enter over here, non plays out NDA, and let's press play. So the input is equal to my item is abandoned, Rome II or III, I guess. Yeah. There's a palindrome because van reversed, it has the same meaning is you got to remind them that that is what a palindrome is. Now. That said for this one. And then the next video I'll show you how to basically write your own input. Like similarly, we have this calculator, right? So we are able to assign our own input. I began to rebel to pass in some Azande something over here. And we can write something over here. This will basically compute distinct. So we can do so by basically using inbuilt method in bitcoin called input, that when we speak about that, we'll be speaking about in the next video. So don't worry about that. Cl gas over there till then. Goodbye and take care. 7. Inputs in Python: Hello and welcome. So in this video we'll be, we'll be basically speaking about inputs. So I'll create a new folder called new file called inputs dot p-y. Oops, I, by mistake, can you name that very much strong? And that's like Rename. And in This is a Python foils and yeah, item file. And right over here, I won't, I'll show you a concept called input. So if I write firstName As equals two, right end port by styled, write the code and then I'll explain, okay. And your name. And there should be no spaces in between by law to remove bad. Again by your first name. So bad guy will enter, defies them. So let's press play and see, Let's see the output and then I'll explain you. Okay? So now if I write firstName CEF, nothing is happening. Okay? So what is happening over here is that by using this metal rod end port, we are able to write something over here. Similarly, like we are able to write in the Calico data, we are able to write something over here inside the input. So by using this method, so whatever is inside this thing will be basically printed off. And it is basically like a question over here. Enter your first name and we are able to write anything over a year. And as soon as I press enter, this value that I'm writing will be moved to this string. So it will basically output a string over here. So as you can see, if I hover it over here, A1 read a string firmer standard output, input, the trailing new line and strip again. So whatever it is, whatever the user will input this like I did over here, will be stored in the form of a string inside of it. So this will be a string. Remember, there's not an integer, it will be a string or it won't if I write a number over here. And if I write a number over here, and if I pass 123, this will still be a string. So it will only return a string if I hover it over here, it says read a string from the input. Okay? So in order to convert it into a string, India are floored. We have to typecast it in this way. So this is how we must type gastric, okay? So I won't be showing that now. Don't worry about it. So now ODR, NP-hardness one, and now similarly like the same line of code for the last name is valid. So I'll just got, so I'm just going to write that last name as it goes to n part. And I'd enter large name. So now if I put in both of them, okay, Um, my sting, My name is firstName and firstName space. Lastname. Let's spin this off. And audio files name it is asking you to write my first name and last name is. Some over there. I'm sorry, over that. Check this working. Yeah. My first name is Muhammad and the last name is fun. So my full name is Muhammad time. So this is how it works. It says this is how the input works. So now we'll move a little bit, moved with a little bit cons. Complex thing. What if I wanted to like similarly in a calculator? What if I wanted to add both of these numbers? Okay? What if I wanted to find the cat input the first number? I asked the user to add the number and move forward. So let's see how we can do that. Okay, So let me comment this out because we do not mean it. Okay, so now what I will do, I will write first num is equals to. Their input will return a string. So whatever the value that a VAR entering will be moved inside this variable over here automatically, and that will be in the form of a string. So what, what do we need now this is a number, we mean now, we now need MDG. So what I will do, I will cast this end. I'll cast this input into our end. Okay? So let me just Yeah, so that you all can see to end important and I'll ride. And the first number. Okay? And similarly I light the same thing for the last number as well and employed and the last number. Okay. So now I will be writing IRD Shun. Yeah, Q later in this video. And now I will leave it here. It has died. And basically add both of these numbers that I have gained access from the user and store it into a stamp. Sum is equals to less. Lastname. Again, I'll just print. We're ending this. Allied sampling. Some corner area likes ideation, are numb and lasts. Lastname is equal to 0. Now, let's input this thing. So it is a different edition calculator. Let me in a word and let me just quickly read Control C and write a CLS so that it basically if you have everything and I'll increase the size of this thing again. So enter the first name and the first name would be something like first number would be something like for FS. Oops, why is it writing where their first letter would be? Four pi pi, and the last number would be free to do that addition of 45 I N32, 2 is 7, 7, 7. Similarly, I will basically do the same thing over a year. And I will multiply it instead of doing this thing and should have writing ambition over here, I will write multi litigation, learned that it meant that it's, we can also write addition and multiply. That is our life. We can't do anything. Yeah, Now let's try now. Firstname, still, and that's the output. The multiplication of 22 is four. Similarly the diploid number is four, and that's like 16. So manipulation four and 16. 16 is 32, 64. Yeah, so this is basically the program for writing and Irish multiplication calculator. Similarly, calculator is a combination of all of these things over here, like multiplication. Yeah, So these are, these are all conditions over here by dense and on. So that's gone. So this thing is made using, I didn't know, I guess I didn't know Java. As far as I know, this is made using Python. And all these things that you're seeing over here. Yeah, this is made using biotin. And yeah. Yeah guys, that's it for this video. And in the next video as a project of this class, we'll be making the elite basically solving the area of a circle. And by using this inputs and complete that as a challenge as well. First I'll be giving a challenge. I'll make sure to try it out by yourself. And then if it doesn't work, it's okay, It's completely fine. You can move forward and follow it. Follow it on with me. Okay. So see you all guys over that and then goodbye and take care. 8. Area of the Circle App: Welcome back, guys, Welcome back. So now in this video we'll be basically completing the talent are the project of this class. So now I will write ADR and our PI. So saddle basically like the problem we first ask the input of the radius of the circle. Okay? Next step is to stall the input of the circle in Florida. Okay? And then after that, let me close this one. The third step would be calculating the calculating the area of the circle. So go ahead and do that. Another challenge right now. But it was very, very simple. First we have to create a sphere, have to write print over here. This is the area. Ya'll, if you later, I'll say. Okay, and I will write something like this. So I'll basically write the value of pi in our list and put the value of Pi asthma. And the value of buy-in because some people like to keep it 3.140, some people like to give it, something like that, until the value of buying. Okay? And after this thing, I'll basically write something like this. Radius, lord. And endpoint. And enter the value of radius of the circle. Okay? And now what I'm showing here is that basically and calculate the area of a circle. And I will write that's like pi r-squared line. So by my deep lined by various Wendy blind radius, that will give me the idea of the surrogate. And now what I want you to, well, the sprint E, This thing, I'll basically write the area of the circle is ADF this, okay? So it was very much symbol. I am sure that you have completed because you know how to do it you now to complete the challenge. So let's press Play and please, let me just quickly write CLS that will clear off everything. Let's first play. This is the ADI calculator of the circle. Enter the value of pi. And if I enter the value of phi as 1.414. Yeah. And going forward when you do by seven. By seven, I don't know, but it's possible. Okay. That's not possible. Yeah. Let me see. Lasagna. Oops. Cls, yeah. Just play again. So that's I went point 4 0 and 4 0 unfold word. And the value of the radius of the circle, the radius of the circle is 12 and the area of the circle is 200, 3.67693. And now what I want you to do over here, I'm actually in this thing. I want you to ask the unit as well. So that's like square meters. Suppose that's like those 200, 3.6793 square meters. So yeah, something like that. So now I want you to basically write an endpoint, like units as equals to end bird. This is a string so we do not need to change the agenda. Florida in detail. So and the units, meters or square meter, the order writers are sending me or something like that. Let's press Play. Yeah, let me press CLS fairly quick and not stressful diagonal. And are the units, I wonder, you know, centimeters. So 3.1.404 and I guess I forgot one thing, but I'm just going to move real quick. So I'm not having this send them he does at the end. So I can basically passing over here as your notes again, and now I'll press this one's here less and yeah, enter the units as distinct as meters. And the value of phi is 1.404. And the radius of the circle is 12. And the area of the circle is 200, 3.61599999. Meet us. So yeah guys, so Malachi relations in isolation for coming this far, activation for completing this class. It was a very small class. It was very much easy. And the next class that I'll be making will be covering complex concepts like conditions, loops at is lists, dictionaries and all that. Okay, So this was just the introduction of Python. So don't worry if you're not able to and understand all of these things, just watch the videos again. I'm sure that yarn and ended enough to understand all of these things. I'm pretty much sure about that. And if you have any kind of doubt or something like that, you can feel free to text me or ask me in the discussion section of this class. So I'll be basically helping you out and remember, all of these words that add all of these files will be uploaded to my GitHub profile that will be on the Skillshare profile you can discover there and find it out. Yeah. So yeah, guys that said CL guys in the next video, I am in next class. The land goodbye and take care.