Given a string in camel case, write a python program to convert the given string from camel case to snake case.
def convert_to_snake_case(str1):
f = True
for c in str1:
if f:
result = c.lower()
elif c.isupper():
result += c.lower()
else:
result += c
f = False
return result
if __name__ == '__main__':
str1= input().strip()
print(convert_to_snake_case(str1))
Comments
Leave a comment