Skip to content

Instantly share code, notes, and snippets.

@loudambiance
Created December 16, 2021 04:12
Show Gist options
  • Save loudambiance/c19a7899f02ae2150320f78836c8764e to your computer and use it in GitHub Desktop.
Save loudambiance/c19a7899f02ae2150320f78836c8764e to your computer and use it in GitHub Desktop.
with open('task1a.txt') as f:
lines = f.read().splitlines()
count = 0
prev = None
for line in lines:
if prev is not None and int(line) > int(prev):
print("++ {}:{}".format(prev,line))
count = count + 1
else:
print(" {}:{}".format(prev,line))
prev = line
print(count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment