Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
capitalize split solution in Clear category for Conversion into CamelCase by sergray
def to_camel_case(name: str) -> str:
return ''.join(map(str.capitalize, name.split('_')))
print("Example:")
print(to_camel_case("my_function_name"))
# These "asserts" are used for self-checking
assert to_camel_case("my_function_name") == "MyFunctionName"
assert to_camel_case("i_phone") == "IPhone"
print("The mission is done! Click 'Check Solution' to earn rewards!")
Oct. 8, 2023