Skip to content

Instantly share code, notes, and snippets.

@usinglight
Created December 2, 2017 13:36
Show Gist options
  • Select an option

  • Save usinglight/1643ddd3352606b8f1298e6d9cfab6f9 to your computer and use it in GitHub Desktop.

Select an option

Save usinglight/1643ddd3352606b8f1298e6d9cfab6f9 to your computer and use it in GitHub Desktop.
aoc2b.py
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