Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db04ed4

Browse files
Umesh-01rounaque-h
andcommitted
pass-gen script using python
Random Password Generator using Python Co-Authored-By: Md Rounaque Afroz Haider <84195978+rounaque-h@users.noreply.github.com>
1 parent dc32195 commit db04ed4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

‎pass-gen.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# importing the required library
2+
import random
3+
4+
# storing uppercase and lowercase letters in different variables
5+
uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
6+
lowercase_letters = uppercase_letters.lower()
7+
8+
# storing digits and special characters letters in different variables
9+
digits = "0123456789"
10+
symbols = "@#$%^&*(){}[]./\?-_"
11+
12+
# setting the values to true that we want to use in our passwords
13+
# if true means we want to use that otherwise not
14+
upper = True
15+
lower = True
16+
numbers = True
17+
special_char = False
18+
19+
# taking a empty string
20+
all_chars = ""
21+
22+
# checking conditions for all variables that we have defined above
23+
if upper:
24+
all_chars += uppercase_letters
25+
if lower:
26+
all_chars += lowercase_letters
27+
if numbers:
28+
all_chars += digits
29+
if special_char:
30+
all_chars += symbols
31+
32+
# taking the password length and number of passwords that we want
33+
pass_length = 15
34+
no_of_passwords = 10
35+
36+
# with the help of for loop, generating passwords
37+
for i in range(no_of_passwords):
38+
password = "".join(random.sample(all_chars, pass_length))
39+
print(password)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /