We can raise this to the exponential rate. We'll do an actual modulus was next to the exponential one here. And finally, we'll do the division and let's just see what the results of each of these will be. So if we go running it then as can see is the addition and subtraction multiplication. This is going to be the division the modulus will basically remain overturn the remainder. So divide by seven would be one with a remained of three as suggested by digital marketing company Delhi India.


That's why we get three printed out. This was days to the seventh power and then because where this is going to be the floor division which will basically discard the remainder tenancies is won and we throw away that remainder of three. Additionally like I said we can actually concatenate or a pair of strings together. So if I said something like string plus guys OK and then went running that again. Then as you can see Hello guys get printed out right there.


So I recall Prince unless we do some fancy printing this is going to print whatever we set these rockets on a new line as you can see I'm in some print tips and tricks right at the very end. Once we finished with all of our language basics from digital marketing company Delhi and now this is a very convenient way to print things out and it's totally flexible. Like I said you can put in two variable values like this you can put in a mix of variable and literal values.


This is called a literal string because it's a literal string value. And then we can put in the mix of variables initials or we can actually just how cholesterol's so just print the number and print the number size. So these are some basic numerical operations. Now let's take a look at some string operations we can perform on strings like this. So to help us so I'm actually going to take a string too and I'm going to have to say something less complicated.


I have to say something like Python is great programming. We'll see if I could spell programming right. Programming Language. OK. Now, first of all, we might want the length of a string so I'm actually just going to comment these all out by the way just use a hotkey command and the forward slash question mark key will comment everything out. And we can just kind of toggle that comment states so now none of these print statements will be executed. And we're just going to move on to our next step down here. So we've already seen we can add strings together or append one string onto the end of another.


Again we might want the length of a string so we can actually just Prince and OK which is going to be short full length and then we can stick a string in here such as print string one, for example, this should return the results of. We go ahead with digital marketing company Delhi and run that. And it's because a is going to be printed out right there. Now we don't want to go up here over time by the way control all will just automatically run your program so press and control.


Right now you can see that it ran and print cell results. OK so some other operations we might once perform on strings I'm going to put all these in separate print statements. So if I start typing string or it's during to then just the name of a string dots then I get this list of options to choose from so I can capsulize it if I want. I could do something like string two dots. Find is something we'll often ones that do so if I'm trying to find some string within here.


Let's see if you can find the string python in some other stuff we might want to do just going to put this on a separate line. You can string two dots and then we can scroll through stuff like is. Alpha is decimal. These will tell you obviously if the string is an alpha string so we can do that. And then also do the decimal so is something like decimal. Next up we might want to replace Dyson's the now string so we could do something like. Again string to replace and we can put something like. Great as trying to replace grates with something like. Fantastic. OK. Some other things we might want to do.


Print string two dots and then something like splits is a perfectly good one. This will just basically form an array and we'll split out each of the items up based on that say we want to split them based on space. Every time you find a space it'll create a new item in an array. So let's just go ahead with digital marketing company Delhi and run these guys. So again a control will run all of them and it will perform the necessary operation. So again appendant stuff to it. This is printing out the number of characters in our string one. Python is a great programming language is just printing this output.


Now capsulized So you know that he was capsulized that was this cool here. It's in this second one after this is going to find the word Python and return the index which starts which indeed is as Python is the first character or the I guess the first substring in this string here. Next is the alphanumerics desk both return false as expected. It's now got the string and replace great with fantastic. And finally, the splits based on the spaces are now going to take each of the strings found within this major string and create a new item in an array here.


So those are your single value variable basics. Like digital marketing company Delhi said the two major types numbers and strings there are slight partitions again between the numerical types such as floats and doubles and integers or floats and doubles the decimal numbers integers all the whole numbers and then strings again. Anything between the double quotes and the single quotes. Generally, we'll be printing out the results of these operations we performed just to get kind of familiar with what we can and can't do with these variables. So I'd recommend you do is play around with these guys a little bit and trace these operations on some glycerol values and some variable values see what you can and can't do and get familiar with these two types.


Hopefully, as you can see already Python is a very flexible language. Seeing as we can pretty easily perform these operations and add things together and stuff like that. So once you are comfortable with both strings and numbers we'll move on to the next section which will be multivalue bearable so we'll take a look at stuff like lists ranges and tuples which will again produce a way to store lots of values within a single variable.

This site was designed with the
website builder. Create your website today.
Start Now