Skip to content

Instantly share code, notes, and snippets.

@chrisguest75
Created July 11, 2021 11:40
Show Gist options
  • Select an option

  • Save chrisguest75/92f5e448d16951719d4ec40e8ff748b1 to your computer and use it in GitHub Desktop.

Select an option

Save chrisguest75/92f5e448d16951719d4ec40e8ff748b1 to your computer and use it in GitHub Desktop.
import random
def complex(length):
characters = []
for i in range(33, 126):
characters.append(chr(i))
password = ""
for i in range(0, length):
c = random.choice(characters)
password = password+c
return password
def simple(length):
characters = []
for i in range(97, 97+(26-1)):
characters.append(chr(i))
for i in range(65, 65+(26-1)):
characters.append(chr(i))
for i in range(48, 48+(10-1)):
characters.append(chr(i))
password = ""
for i in range(0, length):
c = random.choice(characters)
password = password+c
return password
for i in range(0, 10):
print(simple(30))
print("")
for i in range(0, 10):
print(complex(30))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment