diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2022-09-04 19:29:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-04 19:29:42 +0100 |
| commit | 8c9e5428aaba26be7a8b8e18badc1c6c6aac4bbc (patch) | |
| tree | e2baf0bf96d0d987495eac80972d3c1b4acd7f0f /challenge-180/sgreen/python/ch-2.py | |
| parent | 98dad63518b32c2e05f8934440b5d10cb697b9af (diff) | |
| parent | 3bfcb36315febcc0b61b25ad2b996f5e266b6de2 (diff) | |
| download | perlweeklychallenge-club-8c9e5428aaba26be7a8b8e18badc1c6c6aac4bbc.tar.gz perlweeklychallenge-club-8c9e5428aaba26be7a8b8e18badc1c6c6aac4bbc.tar.bz2 perlweeklychallenge-club-8c9e5428aaba26be7a8b8e18badc1c6c6aac4bbc.zip | |
Merge pull request #6693 from simongreen-net/master
sgreen solutions for challenge 180
Diffstat (limited to 'challenge-180/sgreen/python/ch-2.py')
| -rwxr-xr-x | challenge-180/sgreen/python/ch-2.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-180/sgreen/python/ch-2.py b/challenge-180/sgreen/python/ch-2.py new file mode 100755 index 0000000000..1771161bbc --- /dev/null +++ b/challenge-180/sgreen/python/ch-2.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import sys + + +def main(nums): + # Get the last number as the number to compare + n = float(nums.pop()) + + # Get all numbers > n + l = [i for i in nums if float(i) > n] + + # Print the numbers + print(*l, sep=', ') + + +if __name__ == '__main__': + main(sys.argv[1:]) |
