Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Conversion from CamelCase by 126083
def from_camel_case(name: str) -> str:
lista=[]
for x in name:
if x.isupper():
lista.append(x.lower())
else:
lista[-1]+=x
return "_".join(lista)
print("Example:")
print(from_camel_case("MyFunctionName"))
assert from_camel_case("MyFunctionName") == "my_function_name"
assert from_camel_case("IPhone") == "i_phone"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Dec. 13, 2022
Comments: