Ad
  • Custom User Avatar

    no comprendo muy bien lo que hicieste con el [number], pero creo que creaste un arreglo, ahí mismo en el return, con el valor de number?

  • Custom User Avatar

    I used the following testcases for Python:
    Test.assert_equals(validate(79927398713), True)
    Test.assert_equals(validate(79927398710), False)
    Test.assert_equals(validate(79927398711), False)
    Test.assert_equals(validate(79927398712), False)
    Test.assert_equals(validate(79927398714), False)
    Test.assert_equals(validate(2543), True)
    Test.assert_equals(validate(2741), True)
    Test.assert_equals(validate(2841), False)

  • Custom User Avatar

    I am a bit confused on submitting a solution using Test Driven Development.

    I have used a list of credit card numbers from https://en.wikipedia.org/wiki/Luhn_algorithm, and have validated them with my code and they all pass accordingly.

    Invalid: 79927398710, 79927398711, 79927398712, 79927398714, 79927398715, 79927398716, 79927398717, 79927398718, 79927398719
    Valid: 79927398713

    How can I go about implementing this in TDD form?

    I currently have:
    Test.assertEquals(validatecard("79927398713"), true);
    Test.assertEquals(validatecard("79927398710"), false);