greet "hello bobgreet[ 'hprint(greet[ ]greet[ ]greet[ ] print(greet[ - ] notice thatin string of charactersthe last character is at position because the indexes start at this is probably also good time to remind you about the difference between string objects and the actual printed output in the interactions above the python shell shows us the value of strings by putting them in single quotesthat' python' way of communicating to us that we are looking at string object when we actually print the stringpython does not put any quotes around the sequence of characters we just get the text contained in the string by the waypython also allows indexing from the right end of string using negative indexes greet[- 'bgreet[- 'bthis is particularly handy for getting at the last character of string indexing returns string containing single character from larger string it is also possible to access contiguous sequence of characters or substring from string in pythonthis is accomplished through an operation called slicing you can think of slicing as way of indexing range of positions in the string slicing takes the form [:both start and end should be int-valued expressions slice produces the substring starting at the position given by start and running up tobut not includingposition end continuing with our interactive examplehere are some slicesgreet[ : 'helgreet[ : bobgreet[: 'hellogreet[ :bobgreet[:'hello bobthe last three examples show that if either expression is missingthe start and end of the string are the assumed defaults the final expression actually hands back the entire string