You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code uses checksums to make sure the above TILES were typed correctly.
for tile in enumerate(TILES):
assert len(tile) == 26, 'Tile %r has an incorrect length.' % (tile,)
total = 0
for i in range(25):
total += int(tile[i])
assert total % 10 == 0, 'Tile %r is wrong.' % (tile,)
TILES[i] = TILES[i][:25] # Cut off the checksum digit.
the index "i" used in the last line will always have the value 24, resulting in a length assert once it gets to that tile as it will have previously truncated it.
The text was updated successfully, but these errors were encountered:
In the code:
This code uses checksums to make sure the above TILES were typed correctly.
for tile in enumerate(TILES):
assert len(tile) == 26, 'Tile %r has an incorrect length.' % (tile,)
total = 0
for i in range(25):
total += int(tile[i])
assert total % 10 == 0, 'Tile %r is wrong.' % (tile,)
TILES[i] = TILES[i][:25] # Cut off the checksum digit.
the index "i" used in the last line will always have the value 24, resulting in a length assert once it gets to that tile as it will have previously truncated it.
The text was updated successfully, but these errors were encountered: