[Python] LCM using recursive?

Discussão em 'Python' iniciado por Stack, Junho 16, 2025.

  1. Stack

    Stack Membro Participativo

    Here is my code:

    def lcm(a, b):
    if b == 0:
    return a
    return a * b / lcm(a, b)

    print lcm(5,3)


    This is what I could manage so far, any idea on how to find the LCM (least common multiple) of two numbers using recursive and one function?

    Continue reading...

Compartilhe esta Página