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

Tell us what’s happening:

Describe your issue in detail here.
In this project, you are going to learn about list comprehensions in Python by building a program that can take a camelCase or PascalCase formatted string and convert that to a snake_case formatted string.

List comprehensions in Python are a concise way to construct a list without using loops or the .append() method. Apart from being briefer, list comprehensions often run faster.

Start defining a new function named convert_to_snake_case() that accepts a string named pascal_or_camel_cased_string as input.

I think i made it right but dont know why it not work

Your code so far

def convert_to_snake_case(pascal_or_camel_cased_string):


# User Editable Region

def convert_to_snake_case(pascal_or_camel_cased_string):

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Challenge Information:

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

1 Like

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Hello luongpham2000,

Right now you have defined a function, but it has no function body. Which would result in an error. If you need to define an empty function you can add pass in the body to tell the code that for now it doesn’t have to do anything.

1 Like

Oh i see, thank you for helping me