Python Forum
Symbol identification in variables - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Symbol identification in variables (/thread-2721.html)



Symbol identification in variables - Ollie - Apr-05-2017

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).


RE: Symbol identification in variables - j.crater - Apr-05-2017

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-in-a-String?pid=14242#pid14242


RE: Symbol identification in variables - gullidog - Apr-05-2017

(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)