Created
December 16, 2021 04:12
-
-
Save loudambiance/c19a7899f02ae2150320f78836c8764e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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