Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. 1 1 5
  2. 1 2 4
  3. 1 4 2
  4. 2 1 5
  5. 2 2 6
  6. 2 3 5
  7.  
  8. 1 1 5
  9. 1 2 4
  10. 1 3 0
  11. 1 4 2
  12. 1 5 0
  13. 2 1 5
  14. 2 2 6
  15. 2 3 5
  16. 2 4 0
  17. 2 5 0
  18.  
  19. with open('test.sum') as f:
  20. check = 0
  21. for line in f:
  22. if int(line.split()[1]) == check + 1:
  23. check = int(line.split()[1])
  24. print line.rstrip()
  25. else:
  26. check = int(line.split()[1])
  27. print int(line.split()[1]) - 1, 't0'
  28. print line.rstrip()
  29. print int(line.split()[1]) + 1, 't0'
  30. print int(line.split()[1]) + 2, 't0'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement