Task: converting a line from a camel register into a snake
📁 Advanced Python Topics
You need to convert a line from a camel case to a snake case, add the ability to change the separator. I solved the problem, but I would like to know how to solve it more correctly.
def Camel_to_snake ( str , sp = '' ' ): snake_register = '' ' for i in str : if i.isupper: : : : : : : : : Snake_register += Sep +I.Lower () else : synake_register += i Print (Snake_register.lstrip (SEP)) camel_register = 'thisiscamel No answers yet.
Log in to leave an answer
Blogs
How to Check the Quality of a Python Course Before Buying