Back to Freecodecamp

Step 6

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

latest603 B
Original Source

--description--

Call the main function at the end of your script.

--hints--

You should have main() outside of the main function.

js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        assert.match(transformedCode, /\nmain\(\s*\)/);
    }
})

--seed--

--seed-contents--

py
--fcc-editable-region--
def main():
    card_number = '4111-1111-4555-1142'
    card_translation = str.maketrans({'-': '', ' ': ''})
    translated_card_number = card_number.translate(card_translation)

    print(translated_card_number)


--fcc-editable-region--