Instruction
All right, it's time to wrap things up.
text = 'a'ortext = "a"creates a string.string[2]gets the third string character.string[2:5]gets characters with the indices2(inclusive) to5(exclusive).string[2:]gets all the characters starting at index2.string[-1]gets the last string character.string[2:50:3]gets every third character from index2(inclusive) until index50(exclusive).string[::-1]reverses the string.\escapes special characters, including itself.+joins strings.'-'.join(string_list)joins all elements in astring_listand separates them with a'-'.if 'a' in stringchecks whether the string contains at least one letter'a'.for letter in stringiterates over the string.
How about a short quiz now?
Exercise
Click to continue.



