I am trying to help someone with a password validator, but I haven't used Python in a while. I tried making my own validator to understand the process but it won't work
How can I check if the password matches any of the special characters?
Here I wrote a function which will check for special characters.
You need to iterate through each element of the string and check if it is in the list or not.
chars = ["%", "^", "~", "|", "<", ">", "@"]
for c in str:
if c in chars:
print('Special character, ' + c)
print('Alphabet, ' + c)