Learn Python List Comprehension by Building a Case Converter Program - Step 3

Tell us what’s happening:

When i execute this:

def convert_to_snake_case(pascal_or_camel_cased_string):
snake_cased_char_list =
for char in pascal_or_camel_cased_string:
pass

I get the following comment:

Sorry, your code does not pass. Keep trying.

You should write a new for loop with the target variable named char. Don’t forget the colon at the end and to us

Your code so far


# User Editable Region

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

# User Editable Region

    for char in pascal_or_camel_cased_string:
        pass
    for char in pascal_or_camel_cased_string:
    #return pascal_or_camel_cased_string
     pass
    for char in pascal_or_camel_cased_string:
        pass
    for char in pascal_or_camel_cased_string():
        pass

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn Python List Comprehension by Building a Case Converter Program - Step 3

Hi there and welcome to our community!

There’s nothing wrong with the code which you’ve written inside the User Editable Region.

You have a lot of additional code immediately below it though, which shouldn’t be there at all:

1 Like

It worked. Thank you. Have a nice day.

1 Like