#Learn #Python #Together | 🔥 Day 1 | #basics | #loops #conditions #strings | #tutorial for #Students by @techcoderlabz on 3Speak
▶️ Watch on 3Speak --- Source Code: 🐍 Welcome to Day 1 of the Learn Python Basics series! Looks like the original Day 1 recording was accidentally misplaced, so I decided to re-record it with even...
Tags: #python #tutorial #learn #free #beginners #coding #software #development #hivesuite
Hello, dear followers. So, if you take a look at our playlist over here, in this we have day two, day three, day four, day five over here and day six, but there's no day one in this one. In fact, for that we captured the video. but looks like it was misplaced and we are not able to find it so I'm thinking of capturing it one more time and sharing it with you so number one thing that I want to say out loud is whatever we are doing in this learning series We are putting it in a GitHub repository, so you can always go to this repository. It's a public repository and you can go through each and every file over here and learn by yourself. Alright, so let's get started over here. So I'm going to bring the Vs4 right now where I have clone that repository and we have every file over here. So in the first video, which is not present at the moment in this playlist, we basically cover from first file to 95s so 010203 like this you can just know go through this file so let's start with the first one in the first file we talked about using the print statement and we executed hello word so over here right click, run this, Python file in the terminal, and you will see Hello World over here. So that's what we have in the first one. Now let's talk about the conditions and valuable declarations. So you don't have to, like any other programming languages, you don't have to write let or where. You simply set the name of the variable and assign a value to it. Over here, you can see, just like this, x equals to, with this statement, I am saying that x is a variable name. and we are going to assign value to it. Just like that, if you want to declare a float variable, okay, one more thing. Not necessarily X, you can pick any name you want. Over here, I'm saying that my float value over here, and in that, I'm putting this. 75 and 75 and so on, so forth. In the first time over here, let's say we have Saga over here, and then over here, I'm going to change this Sager. So, with this statement number 3, we have declared a string variable. On the fifth line, you can see that I have written a piece of code which is a condition. So, so far, whatever we are writing, it's like executed from top to bottom. But let's say if you want to decide. execute on a condition basis. So let's say only if x equals 2, and the first name equal equals Sagar. So over here, you can see that I have written R over here. So if you want to join multiple conditions, you can join it with an RR. So, and means both conditions should satisfy. And if you write over here, or, it means either of the conditions should satisfy. So let's say in this case, one of the condition is getting satisfied over here, so it's going to print this value. Notice that over here I'm using a different syntax over here in order to print the value of the X. I'm using percentage D and then percent sign and then with that I'm supplying the X value over here. So with that, basically I'm trying to say over here is use the X value and format it and print it over here in the string. So this is the syntax for putting integer and float variables inside a string and then using it inside a string and then using it inside a print statement. Alright, so if I try to run this over here, you can see the output over here that X is holding 1 value and then it says 2. Well, okay, x is holding 1 value 2. which is, I guess, you know, my bad over here, in the condition. So let's say if I change this to this, so in this case, both of the conditions are failing. Now if I try to run this. you can see that it says this one over here. All right, so it's basically conditions are failing, so else part is going to get executed. Over here, we have used percentage D to print the integer value. Just like that, we use percentage F. to print the float value. Sometimes we can use percentage D, sometimes we can use percentage, I also, integer value for that we can use percent, or D. For float, over here you can see that we can use percent I or D integer values. For float, over here you can see that It is 75.8. So, because we are specifying that I only need one fraction, so let's say if I want more, all I have to do is change this percent.2F. Now if I run this over here, you can see that we are getting to up to two fractions. In this one, percentage S we have used for printing a string value. And whenever we are supplying multiple values, we use it like this, we put all the parameters in in a bracket and then we supplied it but let's say if this is getting too complicated what is percentage d percent i percent s so in that case you can simply use the formatted string so for that i'm going to use f and then double codes over here. So this is called formatted string in which, let's say, integer value over here. And for that, I will use, let's say, axe, and then flowed value. And in that, I would simply supply, let's say, my flowed value, and string value over here. and in that I'm going to say first name. So this is much more readable. You don't basically focus on percenti and the sequence of the parameters at the end. You simply set the values in line. So now if I run this, you will get the same output twice. Of course, not exactly the same, but this is one of the exercises for you. Like, you know, how do I use two fraction in formatted string? So this is called formatted string over here, right? There are more basics that we need to cover in this video. Let's quickly go through it. In this file, we understood that this is how we can declare a string, but Python accepts both single-coded string or double-coated string. One thing that you have to keep in mind that whenever you're using, let's say, single -cote inside single-coded string, then you have to use the slas. and just like that, let's say over here I want to put this inside code, double code, then I have to use slas, just like we have used slash over here. Okay, so make sure that if you are using double code string, and then you want to put double quote in the string, then you have to use the slash character, slash quote, slash double quote. So this is how you declare strings, and this is how you declare integer values. And over here you can see that we have done a basic operation addition. over here and then we are printing the value of the third variable which is holding the summation of this two interior variables so over here we just illustrated or say we talked about adding two integers, how do we add two strings so add two string is nothing but joining two strings or more so here we are joining three strings so we have hello and then word and then space over here so we're using hello variable over here then space variable and then word variables So with this, we are drawing these three strings. Let me try running this so that you get the idea about the output over here. Hello Word, you can see in the console. Now, let's talk about more. So I believe this is what we've already discussed in this file. So I guess we are done with that part. So let's go to the next file. Lists. So with the list, you can manage number of values. This example, we are starting with empty list, and this is how you've declared the empty list, and then you keep adding the values with the help of append function. It says integer list, but list is kind of a generic list so I'm gonna change this to generic list over here I think there is a way to do... list is just a list for these five statements we are adding integer values for line number seven we are adding a string and for line number eight we have added a float value so with that with that I guess you have an idea now how does a list work? You can declare like this, or you can also declare a list like this as well. So, let's say over here, Saver, Tech folder, Labs.