Skip to content

Instantly share code, notes, and snippets.

@gilsonbp
Created January 3, 2018 19:31
Show Gist options
  • Save gilsonbp/c274d54233d8b1e47508f34c81bd7a8d to your computer and use it in GitHub Desktop.
Save gilsonbp/c274d54233d8b1e47508f34c81bd7a8d to your computer and use it in GitHub Desktop.
Generates strings with capital letters and numbers
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