diff options
| author | Dave Jacoby <jacoby.david@gmail.com> | 2023-11-30 16:24:21 -0500 |
|---|---|---|
| committer | Dave Jacoby <jacoby.david@gmail.com> | 2023-11-30 16:24:21 -0500 |
| commit | 7fb14aa20db0ed9728c89ec37679ccccbb6bcb9a (patch) | |
| tree | 8957a6e17823f4ab0b763aab9090aba17f0c3aba /challenge-245/eric-cheung/python/ch-2.py | |
| parent | c151cb6f82cb6f756ee57262561c0ead507028be (diff) | |
| parent | a6510c7ef2c4f7d5b56ee3e61564d733e1ad47c2 (diff) | |
| download | perlweeklychallenge-club-7fb14aa20db0ed9728c89ec37679ccccbb6bcb9a.tar.gz perlweeklychallenge-club-7fb14aa20db0ed9728c89ec37679ccccbb6bcb9a.tar.bz2 perlweeklychallenge-club-7fb14aa20db0ed9728c89ec37679ccccbb6bcb9a.zip | |
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
Diffstat (limited to 'challenge-245/eric-cheung/python/ch-2.py')
| -rwxr-xr-x | challenge-245/eric-cheung/python/ch-2.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/challenge-245/eric-cheung/python/ch-2.py b/challenge-245/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..9f531e288b --- /dev/null +++ b/challenge-245/eric-cheung/python/ch-2.py @@ -0,0 +1,8 @@ +
+## arrDigits = [8, 1, 9] ## Example 1
+arrDigits = [8, 6, 7, 1, 0] ## Example 2
+
+if sum(arrDigits) % 3 == 0:
+ print ("".join(sorted([str(DigitLoop) for DigitLoop in arrDigits], reverse = True)))
+else:
+ print (-1)
|
