Skip to content

Commit

Permalink
fix(curriculum): test in password generator project, step 54 (#54804)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario-DC committed May 22, 2024
1 parent 5ac73c6 commit 5a44a9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5a44a9d

Please sign in to comment.