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

I got stuck in step number 3:

The step says the following:
“Use a for loop to iterate through the pascal_or_camel_cased_string . Make sure to name the target variable char which is short for character.”

My code right now!


# User Editable Region

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

# 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/120.0.0.0 Safari/537.36 Edg/120.0.0.0

Challenge Information:

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

2 Likes

for loops work the other way around. You need to iterate over pascal_or_camel_cased_string and use char as the loop variable.
Also, remember to add pass within the loop body.

1 Like

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