Skip to content

Instantly share code, notes, and snippets.

@blacksheep557
Created June 14, 2021 10:48
Show Gist options
  • Select an option

  • Save blacksheep557/2507f387fcfc049068d92bb48e7fbd3e to your computer and use it in GitHub Desktop.

Select an option

Save blacksheep557/2507f387fcfc049068d92bb48e7fbd3e to your computer and use it in GitHub Desktop.
def calcScore(actual, guessed):
result = { "correctPos": 0, "incorrectPos": 0}
for idx, val in enumerate(guessed):
if val in actual:
if actual[idx] is val:
result['correctPos'] += 1
else:
result['incorrectPos'] += 1
print(result)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment