17 lines
365 B
Python
17 lines
365 B
Python
#!/usr/bin/env python3
|
|
|
|
with open("data/input.txt","r") as f:
|
|
myInput=f.read().splitlines()
|
|
|
|
counter=0
|
|
previous=int(myInput[0])
|
|
for item in myInput[1:]:
|
|
if int(item) > int(previous):
|
|
print(previous, item, 'Increased')
|
|
counter=counter+1
|
|
if int(item) < int(previous):
|
|
print(previous, item,'decreased')
|
|
previous=item
|
|
|
|
print('Number of increases: ', counter)
|