String constants in python

The string module has some of the builtin constant variables. We can use this instead of declaring the constants again in our code. Some of the string constants that will be discussed here are, ascii_letters ascii_lowercase ascii_uppercase octdigits punctuation whitespace Let us look at these constants one by one with a code snippet printing each […]

Read More

String methods in python

Strings in Python provide a number of methods. Let’s have a look at them. These following 10 methods are explained in detail with an example for each. strip whitespaces replace substrings manipulate cases split strings join words isaplha(), isnumeric() occurrences of a substring where is the substring? endswith string formatting 1. Strip whitespaces The following […]

Read More