import random
import string
code_str = string.ascii_letters + string.digits
# print(code_str)
def get_code(len = 4):
return ''.join(random.sample(code_str, 4))
print(get_code())
python最简单验证码
最新推荐文章于 2023-05-23 14:56:12 发布
import random
import string
code_str = string.ascii_letters + string.digits
# print(code_str)
def get_code(len = 4):
return ''.join(random.sample(code_str, 4))
print(get_code())