Type in e and be so we are basically checking through on Dhe Falls So what do you think will be the result We get up false value because we need to truth and only when we have to truth darkness one will get the true value Now we’ll check b and it So when it comes to be and if we are basically changing the position of these operations that’s it.
Now it becomes falls on True and the Answer’s Falls Now let me check E on e This will be true and troops when you compare true and true you get a true value And finally let me check be on B You get a false value So this is how the aunt operator works Now let’s go ahead and walk with the or operator So when it comes to the our operator if either of the operations is true or both of the operations are true denigrate true value and only when both of the opens our falls that is when you have a false value.
This time I’ll type in E or be this would mean true or false And obviously we have a true value over here Then I’ll diaper and B or E to this would mean falls or true and we obviously have a true value Now let me go ahead and check e or E so this would mean true are true So when you have to Bruce obviously it’s a true value And then finally let me check B or B and we have a false So this is the only condition though you’ll get a false value when it comes to our So those were their basic operators and python not its head onto Buyten strings So fight and strings are the most widely used in our types.
When it comes to python And as I’ve already told you strings are basically sequins off characters which are enclosed within single courts Double codes for triple courts and triple goods are used to denote my feline string So as you see this example over here I am going to France tomorrow So you have triple quotes around the string because this is presented multiple lines So hello Well as presented single courts this is a string This is Sparta as present and double chords And again this is a string But when it comes to I am going to France tomorrow this is oh my i d line string.
So that’s the basic provides for strengths So now let’s go to Jupiter notebook and walk with these drinks All right so I create a new really below here and I’ll store a string inside this so I’ll we’re in the string Joey doesn’t share is up You can run right So obviously no one likes to share that is up to we right So now let’s go ahead and walk with the strength So let’s say I want to extract the first character who just g from this entire string Now when it comes to python indexing starts from zero So G is basically present that index number zero So if I order extract G I’ll type in the one.
I’ll put in square braces on denial Typing zero and I have successfully extracted the forced liquor and similarly if I want to extract the last character from this entire string so for that you’d have to put in minus one And when I click on run you get the value So this is how you extract the last character from the entire string Now let’s I would extract the sequins off characters So I want to extract this and die award which is doesn’t so 012345 So the index starts at five and it will go on to 6789 10 11 and 12 So let me type in 12 over here.
I’ll pick on run right Would you have given 12 Because when it comes to the second dome Over here it is exclusive so five is inclusive Well is exclusive 012345 b is present IT index number five then 6789 10 and 11 City is presented index number 11 But if you only given 11 over here then you’ll get doesn’t right So what You have to keep in mind us When it comes to the second indexing DM It is exclusive So that is why you have to go in Tell dwells on You’ll get the end I award which is doesn’t now Let’s see How can we check the length off a string So we check the length of a string We have this land function.
Inside Alien I’ll just pass in this variable which is the one on which he had the land of the stringers 24 characters Now when you say 24 So this would include all of the species and all of the apostrophes and full stops and all of those characters as well All right now let’s go ahead and work with some of the inbuilt functions off strings So if I want to convert all of these characters into our bookies So I just have to type in E one and then I have this function upper.
I think on run right So successfully converted all of these characters to capital Similarly if I want to change all of these two small kids so while type in a one dot lower So everything is stolen tow Loki is now similarly if I want title case so I’ll type in Even Dodd I do Right So I have successfully changed all of these words too tight Ikea Suji is capital these capital or here since apostrophe is taking us another character that is white is also given capital and then we have SS capital in the U S Capitol Right.
These were some basic functions when it came to strengths Now let’s go ahead and walk with some non primitive data structures in python for the main non primitive Rhea structures and biting our pupil list dictionary and set So when it comes to all of these data structures you can store my tipple elements inside one beat our structure so they’ll never work with only variables And when it came to wearables we could store only one value in von Variable.
Now let’s see if you go to a music concert and you have to store the names off all the people at in the music concert and the strength off the audience would be around 10,000 So to store the names you would require 10,000 variables Now that’s a lot of fear we will send You have to manually store all of these names inside 10,000 variables That’s a humongous task and that’s her tiresome task So this is where you would need these dear structures where you can store my tipple elements inside one single Dina structure.
Inside of the 40 structure which is basically a pupil So when it comes to do pull it is an ordered collection Off elements include within around breezes so we have curious seasonal here on He’ll be coming in between to give us some pointers So curious isn’t tells is that pupils are immutable now What does he mean when he sees that pupils are immutable.
Basically when you go ahead and create a pupil so let’s say you are five elements inside one pupil now you can’t change or modify the pupil which you have created so that would basically mean that Let’s see if you have five elements then you can’t change the value of the second element or the toward element Or you can add another element inside the tube in which you have already created So this is basically the mutability nature off pupils on This is how you can create a pupil so you’ll use this round braces or here and inside these.
You’ll given the values right So as you see Do Pil is actually your head Trojan Steal a structure So here you are starting a new medical value of character Val You end up bullion value right So let’s go to Jupiter notebook and walk with pupils So let me queda do Bill So I’ll name that you blast you be one and I given the values right So this is our triple Do you be one Let’s see how Kim access individual elements from the stupid accent Elements from pupil is the same as axing elements from a string.