Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1a68e9e

Browse files
authoredAug 29, 2021
Update password.py
1 parent c4a14b2 commit 1a68e9e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎RandomPassword/password.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@
88

99
print("List(s) of Generated passwords: ")
1010

11-
for pwd in range(numPass):
12-
pw=''
13-
for c in range(length):
14-
pw += random.choice(passwrd) # Choice() function returns a random element from a iterable element.
15-
print(pw)
11+
for _ in range(numPass):
12+
print(''.join(random.sample(passwrd, k=length))) #sample() generates an array of random characters of length k

0 commit comments

Comments
 (0)
Please sign in to comment.