alpha()
function
The alpha()
function is used to generate a random string composed entirely of alphabetic characters.
Syntax
Basic
Will return a 6 character long string
strig.alpha() # Example output: 'fBdEIK'
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
length | int | 6 | The length of the generated random string. |
prefix | str | "" | A string to add at the beginning of the generated string. This will add to the length of the generated string. |
case | str | None | Determines the letter case. Possible values are "upper" (only uppercase letters), "lower" (only lowercase letters), or None (mix of both uppercase and lowercase). |