Merge pull request #274 from Rancho2002/feat-modify

Added python-script for generate OTP
This commit is contained in:
Advaita Saha 2022-10-09 21:39:48 +05:30 committed by GitHub
commit 4f0581b4ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.