for examplesuppose string input by user is assigned to the variable user_input if you need to get the last character of the stringhow do you know what index to useone way to get the last character of string is to calculate the final index using len()final_index len(user_input last_character user_input[final_indexgetting the final character with the index - takes less typing and doesn' require an intermediate step to calculate the final indexlast_character user_input[- string slicing suppose you need string containing just the first three letters of the string "fig pieyou could access each character by index and concatenate them like thisfirst_three_letters flavor[ flavor[ flavor[ first_three_letters 'figif you need more than just the first few letters of stringthen getting each character individually and concatenating them together is clumsy and long-winded fortunatelypython provides way to do this with much less typing you can extract portion of stringcalled substringby inserting colon between two index numbers set inside square brackets like thisflavor "fig pieflavor[ : 'fig