mirror of
https://codeberg.org/andyscott/password-generator-cli.git
synced 2024-12-21 12:23:11 -05:00
Added check to ensure length is an integer
This commit is contained in:
parent
0b58ce08c9
commit
855a6bb633
1 changed files with 8 additions and 1 deletions
|
@ -92,7 +92,14 @@ def main():
|
|||
print('Note that ambiguous characters such as 0 (zero) and O (capital o) \
|
||||
are automatically excluded!\n')
|
||||
|
||||
length = int(input('How many characters for your password? '))
|
||||
length = ''
|
||||
while length is not int:
|
||||
try:
|
||||
length = int(input('How many characters for your password? '))
|
||||
break
|
||||
except ValueError:
|
||||
print('Please enter an integer.')
|
||||
|
||||
use_uchars = input('Use uppercase? [Y/n] ')
|
||||
use_nums = input('Use numbers? [Y/n] ')
|
||||
use_symbols = input('Use symbols? [Y/n] ')
|
||||
|
|
Loading…
Reference in a new issue