mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-30 23:41:12 +00:00
13 lines
292 B
Python
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))
|