diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2021-04-04 21:39:38 +0400 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2021-04-04 21:39:38 +0400 |
| commit | e9208ade043f2304225d1e1150f57fa31aa49c28 (patch) | |
| tree | 3e0707caa964c7c6470b3d1779ce0949d81fdee6 /python-func/task8.py | |
| parent | af807d85ec70130dc1b28d82b454d11731f932ee (diff) | |
Добавил 8, 10, 11 задачи по питону
Diffstat (limited to 'python-func/task8.py')
| -rw-r--r-- | python-func/task8.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python-func/task8.py b/python-func/task8.py new file mode 100644 index 0000000..923d598 --- /dev/null +++ b/python-func/task8.py @@ -0,0 +1,9 @@ +def digit_sum(n: int) -> int: + return sum(map(int, str(n))) + +print("Счастливые билеты:") +for i in range(100, 1000): + for j in range(100, 1000): + if digit_sum(i) == digit_sim(j): + print(f"{i}{j}") + |