@HungryBee
I think I follow what it is that you are saying.
Take the If and place it around the all() function and within the all() is contains all the conditions.
I am still stuck and can’t get it to run.
see code below:
if all (constraint <= len(re.findall(pattern, password))
for constraint, pattern in constraints):
Is there a glaring mistake I am making here.
THank you in advance.
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Those square brackets were just an attempt to try somthing different.
These are the versions of the code I have tried so far focussing on trying to complete the if statement.
if (all (constraint <= len(re.findall(pattern, password))
for constraint, pattern in constraints):):
break
if all (constraint <= len(re.findall(pattern, password))
for constraint, pattern in constraints)::
break
I can see I need a colon at the end of the statement for 'if ’ and the ‘all()’ statements and functions, respectively. Am I missing something really silly here?
this is your if statement condition, it needs a colon at the end all() doesn’t need a colon at the end
the for loop is indise the if statement but is not part of the if statement condition
I solved it by jumping ahead to the next stage and looking at the code there.
Here are some pointer for you if you do want to stick to the learning and solving fun.
Place the all() function within the if statement:
I see it as a if all ( …conditions etc… ):
Keep the [ ]'s around the whole argument both the test for <= and for loop.