Skip to content

Instantly share code, notes, and snippets.

@nauar
Created April 23, 2024 16:13
Show Gist options
  • Select an option

  • Save nauar/4d46a3aa39d563aed9d12c7f947a562f to your computer and use it in GitHub Desktop.

Select an option

Save nauar/4d46a3aa39d563aed9d12c7f947a562f to your computer and use it in GitHub Desktop.
Password generator in Python
#!/bin/python
import random
lowercase="abcdefghijklmnopqrstuvwxyz"
uppercase="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers="0123456789"
symbols="/!'@#$%&~().,;:<>"
length=40
pwtype=lowercase+uppercase+numbers#+symbols
# print("".join(random.sample(pwtype, length)))
print("".join([random.choice(pwtype) for x in range(length)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment