Skip to content

Instantly share code, notes, and snippets.

@ntlk
Last active August 1, 2021 18:59
Show Gist options
  • Save ntlk/6954462 to your computer and use it in GitHub Desktop.
Save ntlk/6954462 to your computer and use it in GitHub Desktop.
uniq implemented in python
import sys
last_line = None
for line in sys.stdin.readlines():
if line != last_line:
sys.stdout.write(line)
last_line = line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment