texte = "Le manuel de Python 3" texte[:9] # Résultat : 'Le manuel' (borne début omise) texte[3:12] # Résultat : 'manuel de' texte[13:len(texte)] # Résultat : 'Python' # ou texte[13:] # Résultat : 'Python' (borne fin omise) texte[:] # Résultat : 'Le manuel de Python 3' (shadow copy) # Utilisation du pas texte[:9:2] # Résultat : 'L aul' texte[9::2] # Résultat : ' ePto ' # Indices négatifs texte[3:-2] # Résultat : 'manuel de Python' texte[-21:-14] # Résultat : 'Le manu' texte[::-1] # Résultat : '3 nohtyP ed leunam eL' (inverse le texte)