11. String VariableΒΆ
Store strings as names and general text
We call strings a sequence of symbols such as letters, numbers, punctuation marks, etc.
To differentiate its commands from a string, we use quotation marks at the beginning and end
Note that there is no problem using spaces to separate words
A string has an associated length
We can obtain the size through the
len
function built into Python
We can access the characters in the string using an integer to represent their position in the string
This number is called an index and we start counting from zero
We access the character providing the index between brackets
[]
Caution: we cannot access an index greater than the amount of characters in the string
You have attempted of activities on this page