def to_camel_case(text):
k = text.split("-")
p = case_loop(k)
j = p.split("_")
m = case_loop(j)
return m
def case_loop(k):
p = []
for i,item in enumerate(k):
if i == 0:
p.append(item)
continue
# print(i,item)
a = item[0].upper()
b = item[1:]
c = f"{a}{b}"
p.append(c)
d = "".join(p)
return d
test.describe("Testing function to_camel_case")
test.it("Basic tests")
test.assert_equals(to_camel_case(''), '', "An empty string was provided but not returned")
test.assert_equals(to_camel_case("the_stealth_warrior"), "theStealthWarrior", "to_camel_case('the_stealth_warrior') did not return correct value")
test.assert_equals(to_camel_case("The-Stealth-Warrior"), "TheStealthWarrior", "to_camel_case('The-Stealth-Warrior') did not return correct value")
test.assert_equals(to_camel_case("A-B-C"), "ABC", "to_camel_case('A-B-C') did not return correct value")