Skip to content

Instantly share code, notes, and snippets.

@jmhummel
Created August 5, 2022 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhummel/10ea5bbf8ed6e6fcf5cfbd367829d8ee to your computer and use it in GitHub Desktop.
Save jmhummel/10ea5bbf8ed6e6fcf5cfbd367829d8ee to your computer and use it in GitHub Desktop.
Riddler express 2022-08-05
import itertools
total = 0
count = 0
for s1, s2 in itertools.combinations(range(1, 7), 2):
sum_faces = s1 + s2
if sum_faces == 7:
continue # Opposite faces add up to 7
total += sum_faces
count += 1
print(total/count) # 7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment