Created
December 2, 2017 13:36
-
-
Save usinglight/1643ddd3352606b8f1298e6d9cfab6f9 to your computer and use it in GitHub Desktop.
aoc2b.py
This file contains hidden or 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
| f=open('data2.txt','r') | |
| rows =[] | |
| fsum=0 | |
| for line in f: | |
| row = line.split() | |
| row=[int(i) for i in row] | |
| for i in range(len(row)): | |
| for j in range(len(row)): | |
| if i!=j: | |
| if (row[i]/row[j])==(row[i]//row[j]): | |
| fsum+=(row[i]//row[j]) | |
| rows.append(row) | |
| print(fsum) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment