mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-26 04:01:17 -04:00
fix(curriculum): test in password generator project, step 54 (#54804)
This commit is contained in:
@@ -11,10 +11,16 @@ After your new comment, write a `for` loop to iterate over the `constraints` lis
|
||||
|
||||
# --hints--
|
||||
|
||||
You should write a `for` loop to iterate over the `constraints` list with `constraint` and `pattern`.
|
||||
You should write a `for` loop to iterate over the `constraints` list.
|
||||
|
||||
```js
|
||||
assert.match(code, /for\s+constraint\s*,\s*pattern\s+in\s+constraints\s*:/)
|
||||
({ test: () => assert(runPython(`_Node(_code).find_function("generate_password").find_whiles()[0].find_bodies()[0].find_for_loops()[1].find_for_iter().is_equivalent("constraints")`)) })
|
||||
```
|
||||
|
||||
Your `for` loop should use `constraint` and `pattern` as the loop variables to iterate over the `constraints` list.
|
||||
|
||||
```js
|
||||
({ test: () => assert(runPython(`_Node(_code).find_function("generate_password").find_whiles()[0].find_bodies()[0].find_for_loops()[1].find_for_vars().is_equivalent("constraint, pattern")`)) })
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -51,6 +51,7 @@ def generate_password(length, nums, special_chars, uppercase, lowercase):
|
||||
--fcc-editable-region--
|
||||
# Check constraints
|
||||
for constraint, pattern in constraints:
|
||||
pass
|
||||
--fcc-editable-region--
|
||||
return password
|
||||
|
||||
|
||||
Reference in New Issue
Block a user