Back to Freecodecamp

Step 1

curriculum/challenges/english/blocks/learn-how-to-work-with-numbers-and-strings-by-implementing-the-luhn-algorithm/6565a536ba1f9f25bd30e88b.md

latest847 B
Original Source

--description--

In this project, you will implement the Luhn Algorithm. This algorithm is a formula to validate a variety of identification numbers.

Start by declaring a function called main, this will serve as the entry point of the program. Use the pass keyword to avoid an error.

--hints--

You should have def main(): in your code.

js
({
    test: () => {
        assert(runPython(`
        import inspect
        inspect.isfunction(main)
        `))
    }
})

You should have pass in your code.

js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const pass = __helpers.python.getDef("\n"+transformedCode, "main");
        assert.include(pass?.function_body, "pass");
    }
})

--seed--

--seed-contents--

python
--fcc-editable-region--

--fcc-editable-region--