All right, we're almost kind of flying through this.
I know we're going slow here, but trust me, once you get these data types, things become a lot easier.
So we're just climbing that mountain so that we can start looking at a higher level at the language
of python.
To keep going, let's talk about this data type SDR, which stands for strings.
A string is simply, well, a piece of text, for example, a string can be written with quotation marks
and I can say hi, hello there.
And that is a strength, you see that the color changed here in my ED.
I can also make strings with double quotes.
So once again, this is also a valid string and I can put anything I want in here.
I can do numbers if I wanted to.
Exclamation marks.
It's just a piece of text.
You can think of it as a sentence for now.
And if I do the type function here, remember, these records denote that we want to perform some sort
of action, which is we're using the type action that Python gives us.
And if I click run, you see that?
Well, and remember, we have to print it out as well.
So let's do print so that we can see the display.
And I click, run, you see that it's a star.
It's a type of string.
Now we can use this in important ways.
For example, imagine you're creating a login form and we want to collect somebodies username and password.
Well, we can have a username variable that we assign, let's say, some sort of user name, let's call
it super coder.
And then password can be super secret, and now we have these variables, usernames and passwords that
we can use throughout our program, such as to check if a password exists.
And remember, I can use single quotes or double quotes.
But there's a third way that we can write strings in Python, and this well is used for long strings,
so let's just create a variable long string.
And what we can do here is three single quotes in a row like this.
And then here I can just say, wow, maybe so a pair of eyes of somebody that's really impressed.
And let's go with the mouth.
That actually kind of looks like hair, all right, and then I finish it off with three single quotes
again.
So now if I print.
The long string.
And I click Ron.
Look at that, my little weird emoji face is printed, so the three single quotes is for long strings
that I can keep going on multiple lines.
For example, I can't do this with the single quote.
You see that the orange color is now gone because Python is going to say this is a new line and this
is another line and it's going to give me an error because, well, a kret with a quote doesn't mean
anything.
But if we use three single quotes, you can see that we can do multiline strings.
And this is really useful if you want to have maybe long sentences and paragraphs now with a string,
we do we can do some cool things that we saw in the numbers videos.
What if I had something like this, let's say I wanted to grab the first name of a user.
Just give my own name here and then last name.
And again, my super hard to pronounce last name.
Could we do something like this where we have a full name equals to first name?
And then if we print here the full name.
Should this work?
Well, let's have a look, let me remove this part of here just so we have nice and clean looking code
and if I click, run.
There you go.
My name is printed, but you see that there's no spaces here because we're going to use the addition
sign to attach Andre to Nagoya.
But you can see that there's no spaces here.
So I can add a space if I wanted to, or I can just simply create another string inside of here.
Just like this, and then add a spacing between.
So we're just using the plus sign, which we've seen in the numbers videos, but instead to add strings
together.
And now if I click run.
You see that I got the space because I'm adding a space in here in between the names.
Very, very cool.
But there's a few more neat things that we can do with strings, so let's take a break and I'll see
you in the next video.