Skip to content

Instantly share code, notes, and snippets.

@NicolleLouis
Created August 21, 2017 22:12
Show Gist options
  • Save NicolleLouis/318d745bb1b7f07de4ff91fcd72b651c to your computer and use it in GitHub Desktop.
Save NicolleLouis/318d745bb1b7f07de4ff91fcd72b651c to your computer and use it in GitHub Desktop.
import random
def generateAWord (length):
i = 0
result = ""
while i < length:
letter = chr(97 + int(26 * random.random()))
result += letter
i +=1
return result
def generateFirstPopulation(sizePopulation, password):
population = []
i = 0
while i < sizePopulation:
population.append(generateAWord(len(password)))
i+=1
return population
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment