Browse Source

Simplify slightly.

master
Chris Smith 6 years ago
parent
commit
bc922910b3
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      01.py

+ 3
- 3
01.py View File

@@ -7,6 +7,6 @@ with open('data/01.txt', 'r') as file:
7 7
 # Alternatively...
8 8
 import numpy as np
9 9
 with open('data/01.txt', 'r') as file:
10
-    captcha = file.readline().strip()
11
-    print('Part one: %s' % sum(int(i) for i, j in zip(captcha, np.roll(list(captcha), 1).tolist()) if i == j))
12
-    print('Part two: %s' % sum(int(i) for i, j in zip(captcha, np.roll(list(captcha), len(captcha)//2).tolist()) if i == j))
10
+    captcha = list(file.readline().strip())
11
+    print('Part one: %s' % sum(int(i) for i, j in zip(captcha, np.roll(captcha, 1).tolist()) if i == j))
12
+    print('Part two: %s' % sum(int(i) for i, j in zip(captcha, np.roll(captcha, len(captcha)//2).tolist()) if i == j))

Loading…
Cancel
Save