Python之簡單驗證碼實現
阿新 • • 發佈:2018-04-12
num turn str randint print ice ret int 驗證碼
def v_code():
ret = ‘‘
for i in range(5):
num = random.randint(0,9)
alf = chr(random.randint(65,122))
s = str(random.choice([num,alf]))
ret += s
return ret
print(v_code())
Python之簡單驗證碼實現