Python Forum

Full Version: Symbol identification in variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am a student working on a password checking program, I need help with identifiying if a variable has symbols ("~`!@#$%^&*()_-+={}[]:>;',</?*-+") and add a score to the variable (Score).
Hi, you could get in touch with your classmate working on same issue and brainstorm it together! It's a great learning strategy.
https://python-forum.io/Thread-Symbols-i...2#pid14242
(Apr-05-2017, 09:41 AM)Ollie Wrote: [ -> ]I am a student working on a password checking program, I need help with identifiying if a variable has symbols ("~`!@#$%^&*()_-+={}[]:>;',</?*-+") and add a score to the variable (Score).
symbols = "~`!@#$%^&*()/_-+={}[]:>;',</?*-+"

contains_symbol = False
for symbols in symbols:
if symbols in pw1:
contains_symbol = True
Score+=10
break
print(contains_symbol)