Skip to content

Instantly share code, notes, and snippets.

@NicolleLouis
Last active August 24, 2017 18:07
Show Gist options
  • Save NicolleLouis/ae42fac3eceabf6ef17842e5d81e6be9 to your computer and use it in GitHub Desktop.
Save NicolleLouis/ae42fac3eceabf6ef17842e5d81e6be9 to your computer and use it in GitHub Desktop.
def fitness (password, test_word):
if (len(test_word) != len(password)):
print("taille incompatible")
return
else:
score = 0
i = 0
while (i < len(password)):
if (password[i] == test_word[i]):
score+=1
i+=1
return score * 100 / len(password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment