Strings in Python - Python Tutorial - w3Schools - Ch#09 English

Publicado el: 18 julio 2022
en el canal de: w3Schools Tutorials
197
2

Strings in python are surrounded by either single quotation marks, or double quotation marks.

'hello' is the same as "hello".

Assigning a string to a variable is done with the variable name followed by an equal sign and the string.
You can assign a multiline string to a variable by using three quotes Or three single quotes.

Strings are Arrays
Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters.

However, Python does not have a character data type, a single character is simply a string with a length of 1.

Square brackets can be used to access elements of the string.

Looping Through a String
Since strings are arrays, we can loop through the characters in a string, with a for loop.

String Length
To get the length of a string, use the len() function.

Check String
To check if a certain phrase or character is present in a string, we can use the keyword in.

Check if NOT
To check if a certain phrase or character is NOT present in a string, we can use the keyword not in.


En esta página del sitio puede ver el video en línea Strings in Python - Python Tutorial - w3Schools - Ch#09 English de Duración hora minuto segunda en buena calidad , que subió el usuario w3Schools Tutorials 18 julio 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 197 veces y le gustó 2 a los espectadores. Disfruta viendo!