String Data Type
suggest changeStrings are identified as a contiguous set of characters represented in quotation marks. Python allows for either pairs of single or double quotes. Strings are an immutable sequence data type, i.e. each time one makes any changes to a string, a completely new string object is created.
a_str = 'Hello World'
print(a_str) #output will be whole string. Hello World
print(a_str[0]) #output will be first character. H
print(a_str[0:5]) #output will be first five characters. Hello
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents