Some useful string methods, variables:
There are many usecases you can do with this list like generating password, invitation code and etc from a psecific list.
#python #string #ascii_lowercase #ascii_uppercase #digits #punctuation #whitespace
string.ascii_letters
: in case you want to use alpha characters a-zA-Z
. The output is:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
string.ascii_lowercase
:abcdefghijklmnopqrstuvwxyz
string.ascii_uppercase
:ABCDEFGHIJKLMNOPQRSTUVWXYZ
string.digits
output is numbers:0123456789
string.punctuation
output is special charaters:!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~
string.whitespace
includes all whitespace charaters:\t\n\x0b\x0c\r
NOTE:
space is at the end of the above output, which is not visible.There are many usecases you can do with this list like generating password, invitation code and etc from a psecific list.
#python #string #ascii_lowercase #ascii_uppercase #digits #punctuation #whitespace