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

Tell us what’s happening:

I wrote the"if statement" to check if the current character is upper case I think my if statement is true what did I do wrong?

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:
        if char.isupper():
            return True
        else:
            return False
            pass


# User Editable Region

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

Challenge Information:

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

You are doing a bit more than the challenge requires you to do. Only do this:

  • Add an if statement to check if the current character is uppercase
  • Move the pass statement inside the new if statement

yess It worked! Thank you so much

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