Skip to content

Commit

Permalink
Simplified lines 13 - 15 of logic.py
Browse files Browse the repository at this point in the history
  • Loading branch information
IceTheCoder committed Dec 5, 2022
1 parent b9ae4ef commit 8bfb73d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Binary file modified PasswordGenerator/__pycache__/logic.cpython-310.pyc
Binary file not shown.
6 changes: 2 additions & 4 deletions PasswordGenerator/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ def GeneratePassword(requested_length) -> str:
raises a value error if it's not.
'''

if 1 <= requested_length:
if requested_length > 100:
requested_length = 100
requested_length = min(requested_length, 100)

if 0 < requested_length <= 100:
return ''.join(secrets.choice(characters) for i in range(requested_length)) # This is where the password itself is generated.

else:
raise ValueError

0 comments on commit 8bfb73d

Please sign in to comment.