Learn Python List Comprehension By Building a Case Converter Program - Step 7

Tell us what’s happening:

Please help on this one. The current else statement I have keeps saying error!

Your code so far

def convert_to_snake_case(pascal_or_camel_cased_string):
    snake_cased_char_list = []
    for char in pascal_or_camel_cased_string:

# User Editable Region

        if char.isupper():
            converted_character = '_' + char.lower()
            snake_cased_char_list.append(converted_character)
        else:
            snake_cased_char_list.append(char.lower())

# User Editable Region

Challenge Information:

Learn Python List Comprehension By Building a Case Converter Program - Step 7

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Hi @aguant23

In the else statement, why are you converting the letters to lower case?

Happy coding

Your code is great, just remove .lower()

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.