DEV Community

Cover image for Password Generator
Israel-Lopes
Israel-Lopes

Posted on • Edited on

2 2

Password Generator

Dependencies

  • itertools
  • python3
import string
import itertools

# Define the list of characters that will be used in the password
chars = string.ascii_letters + string.digits + string.punctuation

#Set password length
password_length = 8

# Generates all character combinations with the specified size
combinations = itertools.product(chars, repeat=password_length)

# Prints each generated combination
for combination in combinations:
  password = "".join(combination)
  print(password)
Enter fullscreen mode Exit fullscreen mode

Texto alternativo da imagem)

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay