Live Terminal 🟢

Build a Secure Password Generator

Write and execute your Python code directly in the browser. No installation required.

The Mission

The first line of defense against network intrusion is a cryptographic key. In this interactive lab, you will write a Python script that automatically generates a highly secure, 16-character password using true randomness.

  • Import the random and string libraries.
  • Define the pool of acceptable characters (letters, numbers, symbols).
  • Action: Type the code below into the terminal on the right and click the â–¶ Run button!
import random
import string

# Define the character pool
chars = string.ascii_letters + string.digits + "!@#$%^&*"

# Generate 16 random characters
password = "".join(random.choice(chars) for _ in range(16))

# Output the result
print("SecureT Key Generated:")
print(password)