This function uses the math module and help us to make use of various inbuilt mathematical functions.
This function uses the math module and help us to make use of various inbuilt mathematical functions.
Using the modulus operator you can check whether one number is divisible by another and you can also extract the right-most digit or digits from a number.
The string split method chops up a string into a list of substrings, around a delimiter string. "Whitespace" is considered as the default delimiter.
This code shows how to find the position of a sub-string in a string using the find method.The find method returns the offset where the substring appears.
The method upper takes a string and returns a new string with all uppercase letters.
The operator [n:m] returns the part of the string from the "n-eth" character to the "m-eth" character, including the first but excluding the last.
To replace two characters in the middle of a string, you can use code like this.
This example use Recursive function in which big problem is broken into small problem.