<reponame>AJubatus/advent-of-code-2017<filename>day1/day1p1.py<gh_stars>0
f = open('input.txt', 'r')
input = f.read()

sum = 0
previous = int(input[-1:])

for i in input:
    print(previous)
    i = int(i)
    if i == previous:
        sum += i
    previous = i

print(sum)

f = open('input.txt', 'r')
input = f.read()

sum = 0
previous = int(input[-1:])

for i in input:
    print(previous)
    i = int(i)
    if i == previous:
        sum += i
    previous = i

print(sum)