From 34b74af17a0560dbf072cc99027d97ec9a085a8f Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Mon, 13 Nov 2023 22:52:35 +0100 Subject: Add Python solutions to 243 by E. Choroba --- challenge-243/e-choroba/python/ch-2.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 challenge-243/e-choroba/python/ch-2.py (limited to 'challenge-243/e-choroba/python/ch-2.py') diff --git a/challenge-243/e-choroba/python/ch-2.py b/challenge-243/e-choroba/python/ch-2.py new file mode 100755 index 0000000000..77e9ab82cf --- /dev/null +++ b/challenge-243/e-choroba/python/ch-2.py @@ -0,0 +1,7 @@ +#!/usr/bin/python3 +from math import floor +def floor_sum(*nums: int) -> int: + return sum([floor(i / j) for i in nums for j in nums]) + +assert floor_sum(2, 5, 9) == 10 +assert floor_sum(7, 7, 7, 7, 7, 7, 7) == 49 -- cgit