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

Tell us what’s happening:

hey again! I don’t understand what I am supposed to do??

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()
            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/127.0.0.0 Safari/537.36 Edg/127.0.0.0

Challenge Information:

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

Can you please try talking about how you are stuck?

it’s tells me : ''You should assign the modified character to a variable named converted_character" so what I am doing wrong ?

Click on the Console button and read what it says.

tells me the same thing : You should assign the modified character to a variable named converted_character

That’s not all it says


I think it is

Ok, then please post your current full code.

I get a different message when I post the code you last shared.

THIS IS MY CURRENT CODE:

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():
           char.lower()
           converted_character=char.lower()

It’s the same as the 1st i posted just i removed the pass

This is very different.

What is this line for?

nope my bad that’s i guess is wrong i just put there to test all the possiblities

thank u i found a way to fix it: like this
–removed–

2 Likes

Please don’t post your solution code, thanks!

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like

Hi!
I’m still stuck on this and idk what I should try
this is my current code:

if char.isupper():
converted_character = char.lower()
(the last line is indented, btw)

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.