Skip to content

Commit 838277a

Browse files
Merge pull request prathimacode-hub#916 from sumitsoni0907/otp
Added OTP Generator Script
2 parents 473e244 + 12a440d commit 838277a

File tree

6 files changed

+64
-0
lines changed

6 files changed

+64
-0
lines changed
Loading
Loading
Loading
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# OTP Generator
2+
3+
## Aim
4+
5+
It is a script where we play with One Time Password (OTP).
6+
7+
## Purpose
8+
9+
Generating 6 digits random OTP.
10+
11+
## Short description of script
12+
13+
- One-time Passwords (OTP) is a password that is valid for only one login session or transaction in a computer or a digital device.
14+
- Now a days OTP’s are used in almost every service like Internet Banking, online transactions etc.
15+
- They are generally combination of 4 or 6 numeric digits.
16+
- random() function can be used to generate random OTP which is predefined in random library.
17+
18+
19+
## Workflow of the Project
20+
21+
1. Firstly, import the random library.
22+
23+
2. Now, it will check the conditions passing through loops.
24+
25+
- generating 6 digits otp one by one.
26+
27+
3. print the OTP.
28+
29+
30+
## Compilation Steps
31+
32+
1. Run this program in a proper IDE e.g. Pycharm, VScode ,Jupyter notebook etc or any Online compiler like Repelit.
33+
34+
2. The output will show you.
35+
36+
## ScreenShort
37+
38+
<p align="center">
39+
<img width = 1000 src="Images/image1.png" alt = "image can't displayed"/><br>
40+
<img width = 1000 src="Images/image2.png" alt = "image can't displayed"/><br>
41+
<img width = 1000 src="Images/image3.png" alt = "image can't displayed"/><br>
42+
</p>
43+
44+
45+
## Author(s)
46+
47+
_[Sumit Soni](https://github.com/sumitsoni0907/ "Sumit Soni")_
48+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Write down script for generating 6 digits OTP(One Time Password).
2+
3+
import random as r # import random library
4+
5+
otp = ""
6+
for i in range(1 , 7): # generating otp
7+
otp += str(r.randint(0 , 9)) #generating 6 digit otp using randint function
8+
9+
print("One Time Password(OTP) is",otp) # print the OTP
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This is a very simple, beginner and user friendly script.
2+
3+
All of you need to Dowanload python 3 and install in your device.
4+
5+
Run this script in any IDE like Jupyter nootbook, Visual Studio Code, Pycharm etc.
6+
7+
You can also run this script in online editor.

0 commit comments

Comments
 (0)