how to make otp generator in python

Solutions on MaxInterview for how to make otp generator in python by the best coders in the world

showing results for - "how to make otp generator in python"
Rebeca
24 May 2016
1# Python Program for simple OTP genertaor
2
3import random as r
4# function for otp generation
5def otpgen():
6    otp=""
7    for i in range(4):
8        otp+=str(r.randint(1,9))
9    print ("Your One Time Password is ")
10    print (otp)
11otpgen()