File: lower-bound.py

package info (click to toggle)
kas 5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,268 kB
  • sloc: python: 5,745; sh: 1,095; makefile: 210
file content (11 lines) | stat: -rwxr-xr-x 268 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python3
# takes a reverse-sorted, line separated list and
# returns the first element that is equal or smaller
# than the first argument

import sys

for line in sys.stdin:
    if line.rstrip() <= sys.argv[1]:
        print(line.rstrip())
        break