In this video you will learn about string slicing and case methods of string.
Python provides many ways to fetch substring from a string. It is called ‘slicing’.
It follows this syntax:
string[start: end: step]
Where,
start: The starting index of the substring. The character at this index is included in the substring. If start is not included, it is assumed to equal to 0.
end: The terminating index of the substring. The character at this index is NOT included in the substring. If end is not included, or if the specified value exceeds the string length, it is assumed to be equal to the length of the string by default.
step: Every ‘step’ character after the current character to be included. The default value is 1. If the step value is omitted, it is assumed to equal to 1.
Examples
string[start:end]: Get all characters from index start to end-1
string[:end]: Get all characters from the beginning of the string to end-1
string[start:]: Get all characters from index start to the end of the string
string[start:end:step]: Get all characters from start to end-1 except every step character
#python_video_22 #tarunsir #string #python #python3
Auf dieser Seite können Sie das Online-Video string in python | substring and case methods mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Tarun Sir 18 Oktober 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 299 Mal angesehen und es wurde von 13 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!