diff options
| author | Dave Jacoby <jacoby.david@gmail.com> | 2024-01-22 13:51:41 -0500 |
|---|---|---|
| committer | Dave Jacoby <jacoby.david@gmail.com> | 2024-01-22 13:51:41 -0500 |
| commit | e214c9947ce77a42cf446c9abad0deaff401266e (patch) | |
| tree | ffeda5fe0c5d114b0c827f144ea0c681ded80fcd /challenge-252/deadmarshal/python/ch2.py | |
| parent | 13ec6df65ba66ba1c002f8e2a4d8293c9f8f515f (diff) | |
| parent | 8db85cd488ebedbbda40cca5403676ce0ed8e072 (diff) | |
| download | perlweeklychallenge-club-e214c9947ce77a42cf446c9abad0deaff401266e.tar.gz perlweeklychallenge-club-e214c9947ce77a42cf446c9abad0deaff401266e.tar.bz2 perlweeklychallenge-club-e214c9947ce77a42cf446c9abad0deaff401266e.zip | |
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
Diffstat (limited to 'challenge-252/deadmarshal/python/ch2.py')
| -rw-r--r-- | challenge-252/deadmarshal/python/ch2.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-252/deadmarshal/python/ch2.py b/challenge-252/deadmarshal/python/ch2.py new file mode 100644 index 0000000000..17868430ab --- /dev/null +++ b/challenge-252/deadmarshal/python/ch2.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +def unique_sum_zero(n): + ret = [] + for i in range(1,n//2+1): + ret += [i,-i] + if n % 2 != 0: ret.append(0) + return ret + +print(unique_sum_zero(5)) +print(unique_sum_zero(3)) +print(unique_sum_zero(1)) |
