Skip to content

Instantly share code, notes, and snippets.

@matt2000
Created July 8, 2016 21:53
Show Gist options
  • Select an option

  • Save matt2000/11991679f1f0c534c6b6d2b7e7f35934 to your computer and use it in GitHub Desktop.

Select an option

Save matt2000/11991679f1f0c534c6b6d2b7e7f35934 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
"""excess.py <character> <count>
Outputs rows in stdIn having more than <count> occurences of <character>.
"""
from sys import argv, stdin
for line in stdin:
if line.count(argv[1]) > int(argv[2]):
print(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment