Skip to content

Commit 673253a

Browse files
authored
Merge pull request larymak#66 from MesutKihal/main
Update password.py
2 parents a44e526 + 1a68e9e commit 673253a

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)