Back to Freecodecamp

Step 8

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

latest724 B
Original Source

--description--

It is a common convention to place import statements at the top of your code. And additionally, in case of multiple import statements, sort them in alphabetical order to improve readability.

At the top of your code, import the random module.

--hints--

You should import the random module.

js
({ test: () => assert.match(code, /^import\s+random/m) })

--seed--

--seed-contents--

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

# 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

print(all_characters)