python-scripts/scripts/otp_generator/generateOTP.py
2022-10-09 21:14:52 +05:30

13 lines
292 B
Python

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))