Answers for "python password with special characters"

0

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.')
Posted by: Guest on January-30-2022

Code answers related to "python password with special characters"

Python Answers by Framework

Browse Popular Code Answers by Language