15 lines
357 B
Python
15 lines
357 B
Python
import random
|
|
import string
|
|
|
|
|
|
def get_random_num_code(length=8):
|
|
return "".join(random.choices(string.digits, k=length))
|
|
|
|
|
|
def get_random_letter_code(length=8):
|
|
return "".join(random.choices(string.ascii_lowercase, k=length))
|
|
|
|
|
|
def get_random_letter_and_num_code(length=4):
|
|
return ''.join(random.sample(string.ascii_letters + string.digits, 4))
|