A String is a sequence of Unicode characters that may be a combination of letters, numbers, and special symbols. To define a string in Python, you can enclose the string in matching single or double quotes:
>>>string1="I am enclosed in single quotes." >>>string2="I am enclosed in double quotes." >>>string3='it doesn't look good at all.' >>>print(string3) it doesn't look good at all. To know how the string indexing works in Python >>>s="Hello Python"
To access the first character on the string you just created,type and enter the variable name s and the index 0 within square brackets like this: >>>s you will get output: 'H'
The second statement extracts the character at index position 1 from the first variable and assign it to the letter variable.
Getting the length of the string using len >>>fruit='banana' >>>len(fruit) OUTPUT: 6