Back to Freecodecamp

Step 5

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

latest712 B
Original Source

--description--

Print the translated card number to the console.

--hints--

You should print translated_card_number to the console.

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

        assert.match(function_body, / +print\(\s*translated_card_number\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)
    
--fcc-editable-region--