otp generation in python

Solutions on MaxInterview for otp generation in python by the best coders in the world

showing results for - "otp generation in python"
Matteo
27 Jan 2018
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()
Amelia
29 Jun 2020
1import random as r
2i=100
3while (i>=0):
4    print(r.randint(0,9000)+1000)
5    i=i-1