Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import operator
- file = open('input.txt')
- stack = []
- s = ''
- i = 0
- for line in file:
- line = line.strip()
- if i == 0:
- i += 1
- else:
- stack.append(line.split())
- file.close()
- stack = sorted(stack, key = operator.itemgetter(0))
- file = open('output.txt', 'w')
- for i in stack:
- file.write(' '.join(i) + '\n')
- #print(i)
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement