Skip to content

Instantly share code, notes, and snippets.

@jadowdl
Created May 28, 2020 20:52
Show Gist options
  • Save jadowdl/d365ccc0cc50f8b60dae374b01e31f73 to your computer and use it in GitHub Desktop.
Save jadowdl/d365ccc0cc50f8b60dae374b01e31f73 to your computer and use it in GitHub Desktop.
from random import *
positions = sample([1,2,3,4,5,6,7,8,9,10], 3)
positions.sort()
print(positions)
if positions[2] - positions[1] == 1 and positions[1] - positions[0] == 1:
print(0)
elif positions[2] - positions[1] == 2 or positions[1] - positions[0] == 2:
print(1)
else:
print(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment