Created
January 3, 2018 19:31
-
-
Save gilsonbp/c274d54233d8b1e47508f34c81bd7a8d to your computer and use it in GitHub Desktop.
Generates strings with capital letters and numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import random | |
def get_anscii_digits_string(number_chars: int) -> str: | |
""" | |
Generates strings with capital letters and numbers | |
:param number_chars: Integer value with the amount of scring characters generated | |
:return: A random string based on the number of characters entered | |
""" | |
chars = string.ascii_uppercase.replace('O', '') + string.digits | |
return ''.join((random.choice(chars)) for x in range(number_chars)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment