應用:隨機生成驗證碼

jhchena發表於2024-07-24
點選檢視程式碼
import random

def get_random_code(length=6):
    data = []
    for i in range(length):
        v = random.randint(65,90)
        data.append(chr(v))

    return  ''.join(data)


code = get_random_code()
print(code)

相關文章