Python3 depreciated a bunch of stuff that was availible for Python2, like __floordiv__ and __mod__ for complex numbers along with fractions from the Fraction class, so there isn't any 'nice' way of computing gcd/lcm of fractions without a bunch of setup.
reduce was also moved from being a builtin to functools and has (as of what I'm aware of, and no pun intended) reduced functionality.
Edit: fractions.Fraction apparently does have support for %, but it seems like it doesn't have support for %= (__imod__), which math.gcd's algorithm might use.
Done.
Already approved by someone.
I'm not sure we should still change that second point.
It's not checking the user code, but a predicted compiled code instead I guess.
ok
fixed
What a brainfart xD Your solution works now, could you retry?
even golfing a solution doesn't work
@mauro-1
I would like to add onto this argument a bit.
Python3 depreciated a bunch of stuff that was availible for Python2, like
__floordiv__
and__mod__
for complex numbers along with fractions from theFraction
class, so there isn't any 'nice' way of computing gcd/lcm of fractions without a bunch of setup.reduce
was also moved from being a builtin tofunctools
and has (as of what I'm aware of, and no pun intended) reduced functionality.Edit:
fractions.Fraction
apparently does have support for%
, but it seems like it doesn't have support for%=
(__imod__
), whichmath.gcd
's algorithm might use.This should be fixed now, see my reply to @anter69's comment.
(edit 1: kata not updated yet. This should be done in ~15-20 minutes)
(edit 2: kata has been updated)
I'd considere it a duplicate anyway. There is already a kata (at least) about lcm, and in python it's just about importing one thing anyway.
If strings are kept, it's the same, adding 2
map
steps, so it boils down to the same problem in the end (duplicate, I mean).I've updated the kata. Should (hopefully) be resolved now.
10 more fixed tests were added
Loading more items...