added python-script for generate OTP

This commit is contained in:
Arijit 2022-10-09 21:14:52 +05:30
parent 6a96ef559f
commit 63de434939
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import random
def otp(num):
result=""
if(len(str(num))==10):
for i in range(6):
digit=str(random.randint(0,9))
result=result+digit
return result
else:
s="Enter a valid mobile number!"
return s
print(otp(9874453920))

View File

@ -0,0 +1,5 @@
# OTP GENERATOR
In this project, a 6 digit OTP will be auto generated when user gives a valid 10 digit mobile number. This is written in python and can be implemented in websites as well for authentication.