It is a script where we play with One Time Password (OTP).
Generating 6 digits random OTP.
- One-time Passwords (OTP) is a password that is valid for only one login session or transaction in a computer or a digital device.
- Now a days OTP’s are used in almost every service like Internet Banking, online transactions etc.
- They are generally combination of 4 or 6 numeric digits.
- random() function can be used to generate random OTP which is predefined in random library.
-
Firstly, import the random library.
-
Now, it will check the conditions passing through loops.
- generating 6 digits otp one by one.
-
print the OTP.
-
Run this program in a proper IDE e.g. Pycharm, VScode ,Jupyter notebook etc or any Online compiler like Repelit.
-
The output will show you.