In Python, we can extract a portion of a sequence (lists, strings, tuples etc.) using the slicing operation. Suppose you have a PDF file and need only its name without the .pdf extension. You can use slicing to extract just that portion of the string ...