In some languages, it’s common to use camel case (a variable for a user’s first name might be called firstName, and a variable for a user’s preferred first name (e.g., nickname) might be called preferredFirstName.
Python, by contrast, recommends snake case, whereby words are instead separated by underscores (_), with all letters in lowercase. For instance, those same variables would be called name, first_name, and preferred_first_name, respectively, in Python.
In a file called camel.py, implement a program that prompts the user for the name of a variable in camel case and outputs the corresponding name in snake case. Assume that the user’s input will indeed be in camel case.
What I have so far is this
def main():
for x in camel:
"_"
camel = input("camelCase: ")
snake = camel
print("snake_case: ", snake )
I know its wrong in probably a few places but im very new at this, doing my best. Using "for" confuses me a lot but in the assignment under "hint" it mentions using the for loop so im not sure how to tie it in. Any help is appreciated thank you.