mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Simplify password_generator() (#4333)
This commit is contained in:
parent
cbe4d5f952
commit
ba974810d6
|
@ -16,7 +16,7 @@ def password_generator(length=8):
|
|||
>>> len(password_generator(-1))
|
||||
0
|
||||
"""
|
||||
chars = tuple(ascii_letters) + tuple(digits) + tuple(punctuation)
|
||||
chars = ascii_letters + digits + punctuation
|
||||
return "".join(choice(chars) for x in range(length))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user