cleaned up solution
This commit is contained in:
parent
0bf172a5d8
commit
9d7269d32f
@ -1,16 +1,25 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
def day01Part1():
|
||||||
with open("data/input.txt","r") as f:
|
with open("data/input.txt","r") as f:
|
||||||
myInput=f.read().splitlines()
|
myInput=f.read().splitlines()
|
||||||
|
|
||||||
counter=0
|
counter=0
|
||||||
previous=int(myInput[0])
|
previous=int(myInput[0])
|
||||||
for item in myInput[1:]:
|
for item in myInput[1:]:
|
||||||
if int(item) > int(previous):
|
if int(item) > int(previous):
|
||||||
print(previous, item, 'Increased')
|
# print(previous, item, 'Increased')
|
||||||
counter=counter+1
|
counter=counter+1
|
||||||
if int(item) < int(previous):
|
if int(item) < int(previous):
|
||||||
print(previous, item,'decreased')
|
# print(previous, item,'decreased')
|
||||||
|
pass
|
||||||
previous=item
|
previous=item
|
||||||
|
|
||||||
print('Number of increases: ', counter)
|
print('Part1: Number of increases: ', counter)
|
||||||
|
|
||||||
|
def day01Part2():
|
||||||
|
print('hello')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
day01Part1()
|
||||||
|
day01Part2()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user