Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/learn-list-comprehension-by-building-a-case-converter-program/657ed53c19461d4b95c4757a.md

latest1013 B
Original Source

--description--

You need to add an empty list that will hold the characters of the string after you have converted them to snake case.

Inside the function, replace the pass statement by creating an empty list named snake_cased_char_list.

--hints--

You should replace pass with an empty list named snake_cased_char_list within convert_to_snake_case.

js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const commentless_code = __helpers.python.removeComments(transformedCode)
        const convert_to_snake_case = __helpers.python.getDef("\n" + commentless_code, "convert_to_snake_case");
        const { function_body } = convert_to_snake_case;
        assert.notMatch(function_body, /\bpass\b/);
        assert.match(function_body, / +snake_cased_char_list\s*=\s*\[\s*\]\s*/);
    }
})

--seed--

--seed-contents--

py
--fcc-editable-region--
def convert_to_snake_case(pascal_or_camel_cased_string):
    pass    
--fcc-editable-region--