Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
L1 = dict.fromkeys("1 21 45 62 70".split())
L2 = dict.fromkeys("17 39 50 73 81".split())
L3 = dict.fromkeys("4 28 48 65 90".split())
LINES = (L1, L2, L3)
completed_lines = set()
while len(completed_lines) != 3:
num = input("Next > ")
for n, line in enumerate(LINES, 1):
if num in line:
line[num] = True
total_values = [value for value in line.values() if value]
print(f"Line {n}: {len(total_values)}/{len(line)}")
if n not in completed_lines and all(line.values()):
completed_lines.add(n)
print(f"Line {n} completed!")
print("You won!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment