Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python password with special characters

special_chars =  ['$', '&', '!']

password = input("Provide your password: ")    
invalid = False

for char in password:
    if char not in special_chars:
        print('Invalid char found! Use only: {}'.format(special_chars))
        invalid = True
        break
if not invalid:
    print('Valid password.')
 
PREVIOUS NEXT
Tagged: #python #password #special #characters
ADD COMMENT
Topic
Name
9+8 =