Python | Reverse a String

In Python we can use various methods to reverse a string. Simplest way to reverse a string is to use the slice operation. Output: General syntax of slice operation is string[start:end:step]. In our program start and end are not specified. That means the whole string will be considered. As the step is -1, the string … Continue reading “Python | Reverse a String”

Python | Substring

Substring is a sequence of characters within a string. In Python we can get different types of substrings using slicing operation. Syntax of Python substring: string[start:end:step] start: Starting index of the substring. The substring will include the character of this index. Starting index will be 0 if not specified. end: End index of the substring. … Continue reading “Python | Substring”

0
0
0
0
0
0