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 partition in python

String partition in python can be done easily by using a built-in method called partition(). This method is a string method. There are two string partition methods. partition() rpartition() 1. partition() The partition() method takes a separator as input and split the string at the first occurrence of the separator, and return a 3-tuple containing […]

Read More