Strings
Let’s learn about the string data type and different methods to manipulate strings in Python.
Strings are one of the most popular and useful data types in Python. A string can be created by enclosing characters in either single quotes (' '
) or double quotes (" "
). Python treats single and double quotes the same. Strings are used to record text information (for example, a person’s name) as well as an arbitrary collection of bytes (for example, the contents of an image file).
Get hands-on with 1400+ tech skills courses.