Unsure why it will not let me proceed. I have tried commenting out all lines using a # character for single line comments , have tried the “”“” multiple line comments and even cut the lines out completely.
I must be missing something really dumb/obvious!
Your code so far
/* User Editable Region */
def convert_to_snake_case(pascal_or_camel_cased_string):
pass
"""snake_cased_char_list = []
for char in pascal_or_camel_cased_string:
if char.isupper():
converted_character = '_' + char.lower()
snake_cased_char_list.append(converted_character)
else:
snake_cased_char_list.append(char)
snake_cased_string = ''.join(snake_cased_char_list)
clean_snake_cased_string = snake_cased_string.strip('_')"""
def main():
/* User Editable Region */
print(convert_to_snake_case('aLongAndComplexString'))
if __name__ == '__main__':
main()
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn Python List Comprehension By Building a Case Converter Program - Step 15
Yes, turns out that to pass the test, you need to have exactly ten lines commented out.
I had changed the return value to return pass and it was still being executed.
I thought I hade everything correct, especially after reading this thread, but I still get a messsage telling me: " Sorry, your code does not pass. Keep trying.
You should comment out all the 10 lines of code inside the convert_to_snake_case() function and nothing else. Add pass to fill temporarily the function body and avoid an error."
I tried the code below and I also tried to put the pass on line 2 instead of line 13
Tried to delete line 11 (the empty line) not because it should matter, but because I wanted to exhaust every idea I had before turning to you.
Any hints on where I should start looking in my code?
Figured out what went wrong.
If anyone else has the same problem as I had with my code above.
Here’s a hint, it matters where you put the pound signs (#)