Back to Freecodecamp

Step 14

curriculum/challenges/english/blocks/learn-regular-expressions-by-building-a-password-generator/65647c71a5d2bd431596f629.md

latest724 B
Original Source

--description--

Your generate_password function needs a few parameters. Start by adding a length parameter.

--hints--

Your generate_password function should take a length parameter.

js
({ test: () => assert(runPython(`
    import inspect
    sig = str(inspect.signature(generate_password))
    sig == "(length)"
  `))
})

--seed--

--seed-contents--

py
--fcc-editable-region--
import secrets
import string


def generate_password():    
    # Define the possible characters for the password
    letters = string.ascii_letters
    digits = string.digits
    symbols = string.punctuation

    # Combine all characters
    all_characters = letters + digits + symbols

--fcc-editable-region--