How can I check in Python 3 that a string contains only characters/symbols from a given list?
Given:
allowedSymbols = [\'b\', \'c\', \'z\', \'
This should do it.
for i in enteredpass:
if i not in allowedSymbols:
print("{} character is not allowed".format(i))
break
Not sure what you're looking for with the Score = score -5. If you want to decrease score by 5 if all entered characters are in the allowedSymbols list just put score = score - 5 on the same indentation level as the for loop, but at the end of the code after the if block.