Created
March 21, 2020 11:57
-
-
Save littlekfc/f9148faa560be80937992ef1c4fadcb2 to your computer and use it in GitHub Desktop.
Answer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
total = [(i, j, ii, jj) for i in xrange(2) for j in xrange(7) for ii in xrange(2) for jj in xrange(7)] | |
filled_total = 0 | |
case_total = 0 | |
for case in total: | |
if (case[0] == 1 and case[1] == 1) or (case[2] == 1 and case[3] == 1): | |
case_total += 1 | |
if (case[0] == 1 and case[1] == 1 and case[2] == 1) or (case[0] == 1 and case[2] == 1 and case[3] == 1): | |
filled_total += 1 | |
print '%s/%s' % (filled_total, case_total) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment