Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Hi, everyone, and welcome in this new review.
In this video, we're going to talk about string in Python.
A string is just a way to contain texts in our.
So a string is very useful, for example, if you want to display some information, for example.
So if you want to create a very simple string, I open a pair of quotes and I put in a time and information
and I can run the Senate using shift and serve.
But here we can see that we have.
We still have the quote.
If you want to delete the quotes, we can use the print function, which will allow us to return some
string without the quotes.
Only the content of the quotes of the string.
So you.
So now we are going to see how to have a tabulation in a stream, so it can be very useful, for example,
when you do.
I don't know about this and you want to display some metrics.
So to do it, for example, we can do it like this meme is equal to 10 percent and volatility in 10
percent.
But the problem with this way to right it is that it will be very difficult to see.
Which value is associated?
To which metrics so we can have a tabulation, to a better visualization of our metrics?
So to do and tabulation, we need to put a backslash key operator in the string like this and then.
We have a tabulation.
We can also skip the line if we want.
So to do it, we just have to put the backslash and operator in the street and then we have skipped
a line.
So we have to re, for example, for all you political backrests to display our metrics.
Now we have seen only the very simple way to create a stream.
Sometimes a simple stream is not enough.
We need to create a dynamic stream.
Why?
For example, if you have created an algorithm and each day you want to see the price of an asset,
for example, Tesla, if you create a simple string, you like this Tesla stock price.
At date.
For example, each day, we need to change it manually.
The value so there is no need to put a string if each day we need to change it.
So now we need to use the former function.
In our street, so to do it, we are going to put an empty pair of brothers when you want to add a dynamic.
Found you.
So for us is for the price and for the date.
So.
Then we need to put the former function, and now we need to specify the value, for example this and.
That's.
It's.
Actually, it doesn't make any sense, because now we have also put the value manually, but it will
be very interesting when we are going to walk with a variable in the next video.
So it is very important to understand the way to create the dynamic string, even if now we don't have
a will interest to use it because we don't know variable.
But when we are going to see the variable, this type of string will be very interesting.
So another way to create a more dynamic string is the F Street.
So to do it, we just put a f before the string and.
We put exactly the same string and.
Between the buses, we need to put the variable.
So for us now is just some value.
But
later, it will be very interesting to walk with that.
No, I just want to show you a little specificity.
Since the beginning of the radio, I only write string using a double crypt, but it is important to
know that you can create a string using duplicate or similar quotes.
And here it is mandatory to use simple quotes.
Why is it because we already own in a string?
So if here?
So if you agree to put double quotes, Biton doesn't understand that this.
Is a string inside this big tree, so there is a never so it is really mandatory to put single.
Quote, you know, we are going to see how to round a number into a string, so to do it is really simple.
So I will take only the price of Tesla because they cannot be around.
So in real life, the price of Tesla is.
With many no.
After the point, for example, we can have a price like this.
But for us, all this number, for example.
Or not significant.
So we want to run our no to have a better really visualization when we are going to display this stream
to do it.
We need to use this operative so.
This operator means that we are going to run this number.
With Chew member after the point.
If I change the two in three, for example, we will have three.
If I put one, we have only one, etcetera, then we have one things to do before finished this video,
which is the slicing on a stream.
For example, if I take our first stream, I'm information.
Sometimes we want
to extract some rolled over later to do it.
We can put a pair of broke.
And if you want only a later, you can have the index of this letter.
So in Python, we begin to count from zero.
So the eye here is at index zero.
So if I launch the code, we have only the eye.
If I want the road, for example, we put a double point to say to tell to Python that we want this.
Part of this string is so if I want this, for example, I will put the zero firm from zero to six and
I will have.
Only this part of the string, so it is also important to understand it because sometimes in your own
project, it will be very, very, very interesting to know this slicing on a string because it will
avoid you a lot of work.
So again, I really invite you to play you with all this new operation.
And if you have any problems, you can ask in the Discord forum and the link is here.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.