Back to Freecodecamp

Step 9

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

latest839 B
Original Source

--description--

The random module contains a pseudo-random number generator. Most of its functionalities depend on the random() function, which returns a floating point number in the range between 0.0 (inclusive) and 1.0 (exclusive).

Call the random() function from the random module and print the result.

--hints--

You should print the result of calling random.random().

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

--seed--

--seed-contents--

py
import random
import string


# 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)
--fcc-editable-region--

--fcc-editable-region--